Saturday, January 13, 2018

sql - Calculate the difference between results of two count - subtract 2 table row counts

Try as below.

 select  (select COUNT(*) from table1) - (select COUNT(*) from table1 ) 

No comments:

Post a Comment

Recently Executed queries

 SELECT     txt.TEXT AS [SQL Statement],     qs.EXECUTION_COUNT [No. Times Executed],     qs.LAST_EXECUTION_TIME AS [Last Time Executed],   ...