Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Change this query
NC wrote:
> Hi,
>
> can anyone suggest a better way of writing this query so that it doesn't use
> the MAX function
>
> SELECT u.user_id FROM uname u WHERE EXISTS ( SELECT r.uid FROM urole r WHERE
> u.uid = r.uid HAVING MAX(r.user_role) < 3 )
Several of them but I am in agreement with Frank that this is homework and you need to do it yourself.
A far bigger problem is your total misuse of the HAVING clause. I suggest you go back and reread the sections on GROUP BY and HAVING as well as search the materials at http://tahiti.oracle.com.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Sat Nov 29 2003 - 15:55:01 CST