gpt4 book ai didi

sql - 基本的 SQL 东西……左连接

转载 作者:行者123 更新时间:2023-11-29 03:51:01 32 4
gpt4 key购买 nike

我是 SQL 新手。这没有返回任何结果......

SELECT media.id as mediaid, media.title as mediatitle, 
media.description as mediadescription, media.date as mediadate,
media.duration, media.price as mediaprice, media.thumburl as thumburl,
presenters.f_name as firstname, presenters.l_name as lastname,
presenters.credentials
FROM `media`
WHERE media.title = 'Code of Ethical Conduct'
LEFT JOIN `presenters` ON presenters.fkMediaID = media.id

但在我添加演示者部分之前,它工作得很好......

SELECT media.id as mediaid, media.title as mediatitle, 
media.description as mediadescription, media.date as mediadate,
media.duration, media.price as mediaprice, media.thumburl as thumburl
FROM `media`
WHERE media.title = 'Code of Ethical Conduct'

有什么想法吗?

最佳答案

WHERE 子句放在最后

所以它将是 FROM media LEFT JOIN Presenters .....

WHERE media.title ....

关于sql - 基本的 SQL 东西……左连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1313377/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com