Canman2005 Posted March 25, 2006 Share Posted March 25, 2006 Hi allCan you do a ID range on a sql statement, so it shows ID numbers 1 -200 for example?I use the following code for a simple statement[code]SELECT * FROM users[/code]Can a WHERE ID = 1 -200 be used? Or am I writting the wrong code?Thanks in advanceEd Link to comment https://forums.phpfreaks.com/topic/5771-sql-id-range/ Share on other sites More sharing options...
annihilate Posted March 25, 2006 Share Posted March 25, 2006 Is it just the first 200 rows you want? If so you can use this.[code]SELECT id FROM users ORDER BY id LIMIT 200;[/code]Or if you do actually only want the rows with id between 1 and 200, then use this:[code]SELECT id FROM users WHERE id BETWEEN 1 AND 200;[/code] Link to comment https://forums.phpfreaks.com/topic/5771-sql-id-range/#findComment-20585 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.