Reputation: 1
Im trying to find the total of those who have a membership type platinum. This is what i came up with but its not working.
SELECT COUNT (MType_ID=Platinum)
FROM Membership
WHERE (((Membership.MType_ID)=Platinum));
Upvotes: 0
Views: 68
Reputation: 1883
try this:
SELECT COUNT (MType_ID='Platinum')
FROM Membership
WHERE Membership.MType_ID = Platinum;
Upvotes: 2
Reputation: 44581
SELECT COUNT (*)
FROM Membership
WHERE Membership.MType_ID='Platinum';
Upvotes: 3
Reputation: 44844
You can get the total using sum() as below.
SELECT sum(MType_ID='Platinum')
FROM Membership
If you want can also use an alias for the total as
SELECT sum(MType_ID='Platinum') as total_platinum
FROM Membership
Upvotes: 0