nemethpeter Posted June 10, 2003 Share Posted June 10, 2003 Hello! THere\'s a table with say 5 columns and 60 rows. How can i make a SELECT query, that selects the rows between 20 and 30? (there are id-s in every rows, but as some are usually deleted, it cannot be said, that rows between the id-s 20 and 30) I know, that there\'s a phrase called \'BETWEEN\', but dunno how may i apply it when talkin about rows... Bye NP Quote Link to comment https://forums.phpfreaks.com/topic/570-help-is-needed-in-setting-an-interval/ Share on other sites More sharing options...
Blu_Smurf Posted June 10, 2003 Share Posted June 10, 2003 Maybe you can run a loop count each row and tell it to display 20-30? try http://www.mysql.com and run a search there, that site will tell you everything you could ever want to know in plain english, best sitre ever. Quote Link to comment https://forums.phpfreaks.com/topic/570-help-is-needed-in-setting-an-interval/#findComment-1917 Share on other sites More sharing options...
shivabharat Posted June 10, 2003 Share Posted June 10, 2003 Try this select * from tablename where id BETWEEN 20 and 30 Quote Link to comment https://forums.phpfreaks.com/topic/570-help-is-needed-in-setting-an-interval/#findComment-1918 Share on other sites More sharing options...
nemethpeter Posted June 11, 2003 Author Share Posted June 11, 2003 Ya know, the problem is, that some rows might be deleted (just as i said) and the id-s may come like 1,3,4,5,8,10 and in this way saying that \"where id BETWEEN 1 and 10\" certainly doesn\'t produce 10 rows of data. However, recently I\'ve heard that all rows should be processed, and in the array just the surplus should be deleted... What do you think? Thanks for the answers: NP Quote Link to comment https://forums.phpfreaks.com/topic/570-help-is-needed-in-setting-an-interval/#findComment-1927 Share on other sites More sharing options...
pallevillesen Posted June 11, 2003 Share Posted June 11, 2003 SELECT * FROM table ORDER BY id LIMIT 10 OFFSET 20; will return 10 records starting from record number 20... P. Quote Link to comment https://forums.phpfreaks.com/topic/570-help-is-needed-in-setting-an-interval/#findComment-1928 Share on other sites More sharing options...
nemethpeter Posted June 11, 2003 Author Share Posted June 11, 2003 Thanks a lut! Will try that! ReSPecT: NP Quote Link to comment https://forums.phpfreaks.com/topic/570-help-is-needed-in-setting-an-interval/#findComment-1929 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.