我分两个表格。
my_comment_thumbs [thumb_member_id, Cmt_id, thumb]
my_Comment [id, page, member_id, comment, ip]
umb,thumb= 1
, and,thumb=0
。
[Not sure if that is very clear.]
我曾试图 get上umb子, each倒每一评论。
What I ve got so far [without a full understanding of what I have...]
SELECT
SUM(IF(thumb= 1 , 1, 0)) AS t_up,
SUM(IF(thumb= 0 , 1, 0)) AS t_down,
id, member_id, comment, ip
FROM my_Comment LEFT OUTER JOIN my_comment_thumbs ON member_id=thumb_member_id
WHERE page= 333
非常感谢任何帮助。