SELECT DISTINCT x FROM tab GIVE ORDER BY y A GO, BUT DONT WORRY IF YOU GET CONFUSED, JUST MAKE THINGS A LITTLE MORE ORDERLY THAN THEY WOULD HAVE BEEN IF I DIDNT SAY ORDER BY;
:-) ----- Original Message ----- From: "Dave Smith" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 10, 2003 6:24 PM Subject: Re: [JBoss-user] JBoss Generating Some Bad SQL > If you do not care how it is ordered then why bother with the order by > clause? The database is correct , you are not. > > > Dain Sundstrom wrote: > > > > > On Monday, February 10, 2003, at 01:53 PM, Dave Smith wrote: > > > >> No, it isn't. Consider > >> > >> SELECT DISTINCT x FROM tab ORDER BY y; > >> > >> Assuming there are multiple values of y for any given x, how would you > >> expect the result to be sorted? It's ill-defined. > > > > > > There is nothing ill defined by this. You want all of the distinct > > entries of x ordered by y. If two x values have the different y > > values. I simply don't care which one you choose to order by. Sure > > you can get non deterministic results, but there is enough information > > to execute the query. > > > > -dain ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user