Group by in SQL query:
Input
Students table
student_name dept_name
shiva computerscience
mohan electrical
raju computerscience
ramu electrical
Output:
count dept_name
2 computerscience
2 electrical
Group by in SQL query:
Input
Students table
student_name dept_name
shiva computerscience
mohan electrical
raju computerscience
ramu electrical
Select count(*), dept_name, from students table group by dept_name
Output:
count dept_name
2 computerscience
2 electrical
Comments
Post a Comment