How to make a query which return values for specific ID's not for all.
SELECT content.id, count(case likes.type when 'p' then 1 else null end) as p
FROM content
JOIN likes on likes.content_id = content.id
this code returns:
ID p
1 18
but i want it:
ID p
1 12
2 4
3 2
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…