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