php - query with less than and greater than statements in where clause -


select ( sum(r.marks_attained) / sum(r.total_marks) * 100 )as marks,        s.name   result r,        student s  r.student_id = s.student_id group  r.student_id ,  order  marks desc   

how can students marks percentage greater 90?

can use marks in clause?

try this:

select (sum(r.marks_attained)/sum(r.total_marks)*100)as marks,s.name result r ,student s r.student_id=s.student_id  group r.student_id  having (sum(r.marks_attained)/sum(r.total_marks)*100) >= 90 order marks desc 

i remove query , between , group by, added having clause

p.s: >= 90 (if want include 90, > 90 otherwise)


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -