Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Change this query

Re: Change this query

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sat, 29 Nov 2003 13:55:01 -0800
Message-ID: <1070142930.701496@yasure>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US