PDA

View Full Version : how to combine 2 SQL queries


reteset
07-06-2008, 12:37 PM
i am not sure to write this question under this section
but it can be related with SQLite plugin

well my question is:

how can i combine two SQL queries like below


"SELECT * FROM customers ORDER BY ID DESC"
"SELECT * FROM customers ORDER BY JOINDATE ASC"

simly : i want tu use JOINDATE ASC and ID DESC in one query string

maybe it was simple but i could not figure it out,because my brain is not working for now :huh

thanks for your help

Dermot
07-06-2008, 01:43 PM
You can sort on more than one column like this.

SELECT * FROM customers ORDER BY ID DESC, JOINDATE ASC

reteset
07-07-2008, 11:16 AM
You saved my life
thank you very much ;)