Description

"SELECT 1 FROM TABLE" is a simple way to check if there are any rows in the specified MySQL table. It doesn't retrieve any data from the table but rather returns a result set with a single column containing the value 1 for each row that satisfies the conditions in the WHERE clause (if any).

Let's get into an Example.

Step 1

Step 2

Output Message: (4 rows affected)

Result

No column name

Output Message: (2 rows affected)

Result

No column name

I trust this blog has been helpful in understanding the usage of SELECT 1 From the table in SQL Server. Best of luck.