Difference between count(*) and count(column_name)

count(*)===>The number of records in the table, regardless of whether a field is empty
count(column_name)===>If the current column is empty, those rows with empty columns will

be See the following experiments Result:
SQL> select count(*) from table_name t where t.lvx_id is null;

COUNT(*)
----------
         9

SQL> select count(t.lvx_id) from table_name t where t.lvx_id is null;

COUNT(T.LVX_ID)
---------------
              0

SQL>

[Written on 2009-01-20]

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326983533&siteId=291194637