I did try to get the answer myself by googling it but i can't find the solution.
I've two table actually.
This is suppose students table
id | sname | cid
1 a 1
2 b 2
3 c 2
4 d 3
5 e 4
6 f 3
7 g 4
8 h 3
This is the class table
id | sname
1 c1
2 c2
3 c3
4 c4
I want the result like below:
Result:
id | cname | sname | count
1 c1 a 1
2 c2 b 2
3 c2 c 2
4 c3 d 3
1 c4 e 2
2 c3 f 3
3 c4 g 2
4 c3 h 3
As you can see the result will be like the above all the student name would be show alongside with class name & count would be like that.
How can I do this ?
idandcountid of what? count of what?