我有以下问题。
SELECT WEEK(Review.created) AS Week,
CONCAT(Employee.firstname, ' ', Employee.lastname) AS Name,
AVG(Rating.scale) AS Average
FROM employees Employee
LEFT JOIN reviews Review
ON Employee.id
到目前为止,这似乎是不可能的。有人能给我一个合适的查询或一组可以做到这一点的查询吗?基本上,我需要我所有朋友的签到:他们自己签到的签到,他们用图片签到的签到,非我朋友的用户签到的签到。
我的第一次尝试是这样的:
SELECT checkin_id, author_uid, page_id, coords, tagged_uids, timestamp FROM checkin WHERE (author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) OR author_uid=me()) ORDER BY timestamp DESC L