ktsirig Posted September 8, 2009 Share Posted September 8, 2009 Hello all I wanted to ask if there is a way of inserting some mathematics in an SQL select statement. What I am interested in is to select all rows from a table where 56<ID<67 for example. Thank you Link to comment https://forums.phpfreaks.com/topic/173549-solved-perform-advanced-searches-in-select-statement/ Share on other sites More sharing options...
DavidAM Posted September 8, 2009 Share Posted September 8, 2009 WHERE ID BETWEEN 56 AND 67 However, BETWEEN is inclusive: i.e. 56 <= ID <= 67. So if they are integers your example would be WHERE ID BETWEEN 55 AND 66 or you could do it the long way WHERE (ID > 56 AND ID < 67) Link to comment https://forums.phpfreaks.com/topic/173549-solved-perform-advanced-searches-in-select-statement/#findComment-914814 Share on other sites More sharing options...
ktsirig Posted September 9, 2009 Author Share Posted September 9, 2009 Thank you very much, It was on the manual... I saw it afterwards! Link to comment https://forums.phpfreaks.com/topic/173549-solved-perform-advanced-searches-in-select-statement/#findComment-915381 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.