On 13 Feb 2012, at 1:02pm, Igor Tandetnik wrote:

> bhaskarReddy <uni...@gmail.com> wrote:
>>       How to check whether a table is empty or not. If a table is empty, i
>> want to do some logic. If not another logic.
> 
> select exists (select 1 from MyTable);

Or

SELECT COUNT(*) from MyTable

which will give you 0 if the table is empty, and some other integer otherwise.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to