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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

complicated query

Status
Not open for further replies.

billy83

Programmer
Oct 20, 2006
4
GR
Hello. I have a table (auctions) that i store details about auctions. In this table i have two fileds. Maxbid and bidstart. I want to create an sql statement that will do the following. I want to select all the records and print them ordered by their maxbid. But if the maxbid is 0 then to take the price of bidstart instead. Is this possible?


something like
select * from auctions order by maxbid (but where you find that maxbid is 0 then take the price of the bidstart)
 
What database are you using. The solution to your question will likely depend on it.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks. It worked fine. I didn't know this case "thing". Thanks again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top