Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check whether the data is already exist in table, or to check table is empty

friends, I need help in sqlite query for check whether the data is already exist in table, or to check table is empty or not,let's give queries for it.

Thanks in advance.

like image 907
MGSenthil Avatar asked Oct 18 '25 03:10

MGSenthil


2 Answers

REFINED QUERY

SELECT COUNT(*) FROM TABLE WHERE ROWNUM=1

like image 110
Dead Programmer Avatar answered Oct 19 '25 17:10

Dead Programmer


SELECT COUNT(*) FROM `tableName`;

if the result is 0 the table is empty ;)

like image 37
Andreas Linden Avatar answered Oct 19 '25 15:10

Andreas Linden



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!