Number of Records [modified]
-
Hi! How to get the total records in a table? The following query returns an irrelevant number like 39685832(not the same all the time). I'm using SQLite. How to get the no.of records from a SQLite table?
"SELECT COUNT(*) FROM current"
modified on Tuesday, October 5, 2010 7:23 AM
-
Hi! How to get the total records in a table? The following query returns an irrelevant number like 39685832(not the same all the time). I'm using SQLite. How to get the no.of records from a SQLite table?
"SELECT COUNT(*) FROM current"
modified on Tuesday, October 5, 2010 7:23 AM
Your table does have a primary key field, or unique index at least, doesn't it? Try counting on that, eg
SELECT COUNT(ID) FROM tablename
Is "current" really your table name? I am not sure about suing that... it is a reserved word[^] - at least try enclosing it in delimters if you must use that name. Otherwise, change it.
-
Your table does have a primary key field, or unique index at least, doesn't it? Try counting on that, eg
SELECT COUNT(ID) FROM tablename
Is "current" really your table name? I am not sure about suing that... it is a reserved word[^] - at least try enclosing it in delimters if you must use that name. Otherwise, change it.
Hi! This query doesn't work. Actually I'm passing SQLite query from C++. When I run my C++ program, it crashes and the console displays "SQLError: No such column ID". I've tested this with another table(profile instead of current)also. How to get the number of rows in a table?
-
Hi! This query doesn't work. Actually I'm passing SQLite query from C++. When I run my C++ program, it crashes and the console displays "SQLError: No such column ID". I've tested this with another table(profile instead of current)also. How to get the number of rows in a table?
Well use the name of a column you do have then, if ytou haven't got an ID field. :doh:
-
Well use the name of a column you do have then, if ytou haven't got an ID field. :doh:
Can you tell me the type(INTEGER or TEXT) that the above query returns?
-
Can you tell me the type(INTEGER or TEXT) that the above query returns?
It should return an integer
-
Can you tell me the type(INTEGER or TEXT) that the above query returns?
It's printed correctly. Query's return type is an array string(I've implemented like that). So, I've to convert it to int using atoi.