1
這裏是我的查詢Mysql左外連接限制?
SELECT `t`.`id` AS `t0_c0`
, `news`.`id` AS `t2_c0`
, `news`.`title` AS `t2_c1`
, `news`.`url` AS `t2_c2`
, `news`.`date` AS `t2_c3`
, `news`.`hash` AS `t2_c4`
, `news`.`list_id` AS `t2_c5`
FROM
`words` `t`
LEFT OUTER JOIN `words_news` `news_news`
ON (`t`.`id` = `news_news`.`word_id`)
LEFT OUTER JOIN `news` `news`
ON (`news`.`id` = `news_news`.`news_id`)
WHERE
(`t`.`id` IN (8229, 8574, 7901))
,我需要從news
表只選擇5日消息,但不知道怎麼了,我應該怎麼寫查詢?
沒有工作,所有選中的行爲空! – teMkaa 2012-08-16 10:48:44
嘗試新的更新的查詢。 – Omesh 2012-08-16 10:54:52
您錯過了「@var_ctr」<= 5「後,但無論如何,它只選擇了1個字(最後一個ID爲7901)和5條新聞,所以我認爲我們非常接近正確的查詢!感謝您的幫助! – teMkaa 2012-08-16 11:05:06