我試圖從brews
和recipes
表中獲取信息基於表中跟隨有多少追隨者,但我得到一個SQL錯誤,因爲我正在返回我的查詢中有多個結果。我應該把它分成兩個查詢嗎?或者是有作爲變通,讓我在我的外WHERE
聲明SQL查詢與查詢返回多個結果
SELECT
b.bid AS bid, b.name AS bname,
r.name AS recipe, b.status AS status,
r.rid, a.f_name, a.l_name, a.pic_loc, a.uid AS uid
FROM
recipes r, brews b, account a
WHERE
b.uid = (SELECT followed FROM follow
WHERE follower = '#cookie.id#')
AND b.rid = r.rid AND b.uid = a.uid
GROUP BY b.bid
ORDER BY b.time DESC