I have a user table that contains username, password and status jobs. The user have a option to fills unemployed and employed in jobs field. My question how to make sql statement to count how many people that choose unemployed and employed. Then view the result for number of unemployed and employed.

Recommended Answers

All 4 Replies

Use a query that groups users by status and in the second column put their count. Try to form a query for this.

select count(*) as total from user group by jobs

-----------------------------
Total ------ Jobs
-----------------------------
10 ------> Unemployed
20 ------> Employed


Cheers!

@nav33n : I chose not to give him the exact query but describe what it should be like and let him do the work.

@nav33n : I chose not to give him the exact query but describe what it should be like and let him do the work.

I know. But I was in a good mood to write it for him :)

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.