Jump to content

Select a range between


christa

Recommended Posts

Sadly theres no such a thing as ROWNUM or ROWID in MySQL.

 

Im only guessing, but ive had an idea, and this is the result.

SET @num = 0;
SELECT (@num:=@num+1) AS abc, id, name FROM user__group GROUP BY abc HAVING abc > 2 AND abc < 4

 

@num is the alternate of ROWNUM. You cannot use @num in the WHERE clause, so you need the GROUP BY clause for the HAVING...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.