I use SQL COUNT function to get the total number or rows from a table. Is there any difference between the two following statements?
COUNT
SELECT COUNT(*)
count(id) needs to null-check the column (which may be optimized away for a primary key or otherwise not-null column), so count(*) or count(1) should be prefered (unless you really want to know the number of rows with a non-null value for id).