What is a result of SELECT COUNT(*)?

Experience Level: Senior
Tags: DatabasesSQL

Answer

The result is 1.

On most databases you can execute the following query: SELECT 1+2. There is no FROM clause yet it still works and returns calculated result 3. Try to think about it as if the database system created a table with zero columns and one row. Then if you execute SELECT Count(*) FROM [ImaginaryTable], the result is 1.

Comments

No Comments Yet.
Be the first to tell us what you think.