sql server - Subtraction between two sql queries -


I have 2 questions in MS SQL which return many results using the COUNT function.

I can run the first query and get the first result and remove the second to get the second result, reduce them and get results; However, there is a way to combine all 3 functions and get 1 overall result

As: sql1 runs sql2 run SQL3 (sql1-sql2)? ....

I tried them as a function xxxx but there is no luck.

You should be able to use subqueries for this:

   

Just check it out:

  difference ------------45 (1 line affected)  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -