Dovberman
asked on
Need to count values when a column contains 2 possible values. Stored Procedure
I have a column whose value can be either 'R' or 'O' indicating owneres and renters.
I need a sql statement that returns the total number of renters and owners in an 'Renters' column and
'Owners' column.
for Example:
Owners Renters
1392 8372
Psuedocode:
Select from tablename
Count(Where fieldname value='O') as Owners,
Count(Where fieldname value='R') as Renters
FROM TableName
What is the syntax?
Thanks,
I need a sql statement that returns the total number of renters and owners in an 'Renters' column and
'Owners' column.
for Example:
Owners Renters
1392 8372
Psuedocode:
Select from tablename
Count(Where fieldname value='O') as Owners,
Count(Where fieldname value='R') as Renters
FROM TableName
What is the syntax?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just replaced the 'when when' with 'when'
Thanks,