我有一个查询,它返回两行数据作为计数。我想找到列值的总和。我的 sql:
(SELECT count(memberid) count
FROM `friendRequest`, Member
where status = 2 and memberid = sender and receiver = 19)
UNION
(SELECT count(memberid) count
FROM `friendRequest`, Member
where status = 2 and memberid = receiver and sender = 19)
我试过使用Select Sum(my above query)
,但我收到错误。我只需要上面的一些值。