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!

One problem w/ LIMIT in CASE statement

Status
Not open for further replies.

clemrock

Programmer
May 20, 2004
118
US
Hello,

I'm having a problem w/ the LIMIT clause when I'm using this CASE statement.

This is working like a dream:
SELECT * FROM table ORDER BY CASE table_id WHEN 54 THEN 0 ELSE 1 END, table_id LIMIT 50

Only problem is
I would like to do a limit start, stop statement at the end rather than a

limit stop statement.

How would you do this:

SELECT * FROM table ORDER BY CASE table_id WHEN 54 THEN 0 ELSE 1 END, table_id LIMIT 50, 50

Once I add the second part of the limit, I lose the idea of displaying table_id=54 first.

Thanks a lot!

Clem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top