[PLUG] SQL Syntax

Mark A. Turner turner at glsuite.com
Mon Nov 6 16:08:38 UTC 2006


 
> My SQL is quite rusty, but I am suspicious about being able to order
> results on a field that isn't being selected.  You might want to try
> adding the "Number" field to the SELECT list.

ORDER BY is based on the table your selecting from, not the data your
selecting.

So:
 SELECT v.Type from veggies v
 ORDER BY v.Price,v.Quantity

Would select all the data from the Type column and sort that based on
Price, then Quantity before returning the results. This is pretty much
common among all SQL servers.

-mark


> 
> 
> --
> Russell Senior         ``I have nine fingers; you have ten.''
> seniorr at aracnet.com




More information about the PLUG mailing list