Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Using MIN with GROUP BY
I am having a problem gaining specific results from the SQL statement
I've wrote. Without paying too much attention to the data, please
help.
My SQL statement:
SELECT can.name, cook.flavor, cake.icing, dnuts.cake,
MIN (dnuts.max_avail)
FROM candy can,
cookies cook, cake cake, doughnuts dnuts
cook.flavor, cake.icing, dnuts.cake My results: row name flavor icing dnuts min 1 snickers chocolate chocolate cake 21 2 mars chocolate chocolate nocake 25 3 butterfinger peanut butter vanilla cake 24
I thought this would only give me back row 1. But it seems as though it is basing my MIN off of the groups instead of the rows.
Does anyone know how I can write it without using a HAVING clause so that I only get row 1?
Thanks
DT
Received on Wed Apr 23 2003 - 17:15:19 CDT
![]() |
![]() |