-3
我有使用按預期運行下面的查詢,最近的記錄的數量已經長大,不知它在返回#1242 - Subquery returns more than 1 row
解決方案的子查詢返回超過1行
SELECT `log`.id,log.account_id,log.type,
(SELECT COUNT(*) FROM instagram_log as LIKES WHERE `account_id`=log.account_id AND `type`='like' AND log.target_account=LIKES.target_account AND `seen`=0) as has_liked,
(SELECT COUNT(*) FROM instagram_log as Comments WHERE `account_id`=log.account_id AND `type`='comment' AND log.target_account=Comments.target_account AND `seen`=0) as has_commented,
(SELECT information FROM instagram_log as Source WHERE `account_id`=log.account_id AND `type`='follow' AND log.target_account=Source.target_account AND `seen`=0) as source,
(SELECT data FROM instagram_accounts WHERE `id`=log.account_id) as InstagramInfo
FROM `instagram_log` as `log` WHERE `type` = 'follow_back' AND `account_id` IN('1', '5', '2') ORDER BY `id` DESC LIMIT 15
有什麼有關錯誤MESSA你不明白? –
你知道哪個子查詢是問題嗎? –