Link to home
Start Free TrialLog in
Avatar of Tpaul_10
Tpaul_10Flag for United States of America

asked on

Getting Count(*) into a varibale

Experts,

here is my sample code and have tried multiple options and couldn't get it worked to assign the count(*)  to my variable so that I can use that value for later


Declare @@Total

SELECT @Total  = count(*) FROM (
SELECT  T1.ItemID
FROM MyDatabase..MyTable T1
INNER JOIN
INNER JOIN
INNER JOIN
...
WHERE
GROUP BY T1.ItemID
      HAVING  
)
 

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tpaul_10

ASKER

Thank You Aneeshattingal, appreciate your quick help