Hey all,

I have two tables one of which contains information about users (id, name ,department, team) and the other table is of team(is, name, leader) i joined users with team and aome other tables to display |team name|Team Leader| Supervisor|department| etc now i want to add one more column named Total_team_members this is supposed to be the count of user_id's from table users who have team_id same. my new display will be |team name|Team Leader| Supervisor|department|Total_team_members| my question is that how can i use count(user_id) function here in this query where the query is already joined with some tables including users

Please help

You can group the whole query by the team.id and use the count function on this aggregate.
For further help submit the explicit data structures and your query.

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.