Jay Raotole
Jay Raotole

Reputation: 45

sqlite greater than or equal to 1 query not working

I have a table with field q4 as type integer(10) with default value 0.

I want results where q4 is greater than or equal to 1.

I have tried this in sqlite.

SELECT * FROM g101 WHERE  q4 >= 1

But it is showing two rows with value of 0.

Please help,

Thank in advance

Upvotes: 2

Views: 4276

Answers (1)

CL.
CL.

Reputation: 180080

sqlite> create table g101(q4);
sqlite> insert into g101 values (0), ('0');
sqlite> SELECT * FROM g101 WHERE  q4 >= 1;
0

Apparently, you have text values in your table.

(Please note that SQLite pretty much ignores column types.)

Upvotes: 4

Related Questions