Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

Select Count 2 columns

I have a table that has a column called afsTransaction

In the column can be any integer from 0 to 10000

I need a single select statement so that I get the UID, count(afsTransactions=0), count(afsTransactions <>0)

My currect (partial) select is attached.
Set	@afsCount = (Select Count(*) 
				from proc_cfa.dbo.P_AvailableForSale
				where	substring(afsSource,4,4) = @DealID
					and
					afsTransaction <> 0)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America 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 Larry Brister

ASKER

Thanks