[DB-SIG] Multiple Fields in "Order by" Command

Chris Cogdon chris at cogdon.org
Wed Nov 24 02:07:45 CET 2004


On Nov 23, 2004, at 16:56, Casey Bralla wrote:

> I'm trying to sort my database by multiple fields.  I have written a 
> query
> that says:
> "select * from TABLE1 order by FIELD1 + FIELD2 + FIELD3"
>
> Unfortunately, while I can sort by any single FIELD, I am unable to 
> create the
> multi-field sort I want to create.  I've tried parentheses, using the 
> "&"
> sign, etc.  I figure there's gotta be an easy way to do this... but 
> I'll be
> darned if I can find it in the docs or on-line.
>
> Can somebody please point me in the right direction?

orderbyfields [ 'field1`, 'field2', 'field3' ]
"select * from table1 order by" + ",".join ( orderbyfields )


-- 
    ("`-/")_.-'"``-._        Chris Cogdon <chris at cogdon.org>
     . . `; -._    )-;-,_`)
    (v_,)'  _  )`-.\  ``-'
   _.- _..-_/ / ((.'
((,.-'   ((,/   fL



More information about the DB-SIG mailing list