Hello guys! Please help me with a little problem.

I have one table(Person) where are some values.

My current syntax is:

SELECT Status, COUNT(Name) AS Number
FROM Person
WHERE Status = 'Married';

Result:

Status_________Number

Married__________3

But I want to get the result for each status.
That would be something like this:

Result:

Status_________Number

Married__________3
Divorced_________2
Single___________4
Widowed_________1

How to conclude my SQL syntax and get this result?

Any help is the most welcome.

Change line 3 to:

GROUP BY Status

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.