sql - mysql select after where -


i have sql:

select count(*)    table_a a,         table_b b   a.something=0         , b.active=1         , (select c.avg(rating)                table_rating c               c.id=a.id)>=$rating 

this part doesn't seem work

and (select c.avg(rating)         table_rating c        c.id=a.id)>=$rating 

how can fix it?

edit: problem here select c.avg(rating) should select avg(rating)

try this

select count(*)  table_a a, table_b b  a.something=0 , b.active=1 ,  (    select avg(c.rating)    table_rating c    c.id=a.id  ) >= $rating 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -