Hi,
Can any one please tell me, how to write query for the below example.
Standard TotalStudents Name
2 50 Raj
2 40 Sathish
3 35 Ganesh
4 50 Raj
5 40 Raj
The resulting query should display the total no of students and in another column the number of students whose name matches "Raj".
Like:
Toal Students Name
215 3
I can write query like this
select SUM(TotalStudents) as 'Total Students', (select SUM(TotalStudents) from student where name like 'Raj') as 'Name' from student.
Is there any other way to write it.
And also if i want to get the remaining students whose name don't matches with 'Raj' as another column.
Please reply soon..
Thanks in advance
Regards,
Prakash