SQLite Select an id which is smaller than a number

Posted by user345039 on Stack Overflow See other posts from Stack Overflow or by user345039
Published on 2010-05-20T08:30:04Z Indexed on 2010/05/20 8:40 UTC
Read the original article Hit count: 139

Filed under:
|

Hi,

I am trying to only select the objects where the id is smaller than an int value.

e.g.: i have 3 objects -> id = 1, id = 2, id = 3 Now I want to only get the objects with the id smaller than the variable i = 2;

How can I manage this?

sql = "SELECT id FROM table_name WHERE id <= i";

Thanks ;-)

© Stack Overflow or respective owner

Related posts about sqlite

Related posts about select