Buy Now
Sign in

Many to many relation sorting problem

samir1903 , August 29 2022, 13:53
S
samir1903 187
August 29 2022, 13:53 #398794
Hi,
Students
ID
name
surname
Absence
ID
Student_ID
absence_number
reason
so here each students have a lot of absent records, I want to show total absence per student, sum(Absence.absence_number):Students.absence_total works perfect.
The problem is if I show one to many relationship it shows lots of empty pages, I have do many to many relationship (group by Absent.ID) this time I cannot sort Students.absence_total I cannot even use in where clause. I want to make it with many to many relationship I think it is ideal. but how to sort and use it in where clause.
GreyHead 65
August 30 2022, 09:51 #398799
Hi samir,
There is a post on StackOverFlow here that may help you.
Bob
S
samir1903 187
August 30 2022, 10:57 #398800
Hi GreyHead,
I don't know what do you mean, how can I use mysql like having count distinct in read_data somewhere.
HAVING COUNT(DISTINCT