Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two sets of rows from query 1

Status
Not open for further replies.

fordtran

Programmer
Jun 15, 2005
101
ZA
I have a setup similar to Google. I have a table with clients. In my flexgrid I have to divide these clients into two categories.

First I have to list all clients who have paid their subscription - say a field called paid - and I have to sort them alphabetically.

Then I have to add all the other clients who have not paid and arrange them alphabetically.

The SQL would read :
SELECT * from clients (where paid=true SORT by clientname) ADD after this (where paid=false SORT by clientname)

No unpaid client can appear before a paid client.

Thanks you gurus.






fordtran
 
why not just
Code:
SELECT * from clients 
order by paid, clientname
or
Code:
...by paid desc, clientname asc
if need be.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top