Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

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
[EMAIL PROTECTED]
(replace 'x' with a 'u' to reply)




<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.