gpt4 book ai didi

mysql - 内连接中的 where 子句

转载 作者:行者123 更新时间:2023-11-29 19:52:16 25 4
gpt4 key购买 nike

我正在生成一个查询。我有两个表名称:航类和目的地。在航类表中,我有列:id、出发地、目的地、价格、航空公司、舱位,在目的地表中,我有列:id、目的地、国家/地区。

现在我想获取区域为“欧洲”的航类详细信息。我正在做内部联接。我的查询是这样的:

SELECT * 
FROM `flights`
INNER JOIN destinations ON flights.destination = destinations.destination
where region= 'europe'

它给了我空结果。如果我从查询中删除 (where Region= 'europe') ,那么它会给我所有航类和目的地列的结果。

请帮帮我

最佳答案

试试这个

SELECT * 
FROM `flights`
INNER JOIN destinations
ON flights.destination = destinations.destination
where LOWER(region) = 'europe'

关于mysql - 内连接中的 where 子句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40789053/

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