我有这个工作正常的查询:
SELECT c.id, c.name
FROM job j
LEFT JOIN portfolio_job_category pjc ON pjc.job_id = j.id
LEFT JOIN category c ON c.id = pjc.category_id
WHERE j.end_date >= DATE( NOW( ) )
AND pjc.portfolio_id =3
GROUP BY c.id
ORDER BY `c`.`id` ASC
LIMIT 0 , 30
但是当我在下面进行查询时它不起作用并返回空行:
SELECT c.id, c.name
FROM commstratjobs.job j
LEFT JOIN commstratjobs.portfolio_job_category pjc ON pjc.job_id = j.id
LEFT JOIN commstratjobs.category c ON c.id = pjc.category_id
WHERE j.end_date >= DATE( NOW( ) )
AND pjc.portfolio_id =3
GROUP BY c.id
ORDER BY c.name;
LIMIT 0 , 30
有什么原因吗?
我唯一做的就是在表格前面添加数据库......