0
我有以下MySQL查询:MySQL查询适用于自己的,但不是作为一个IN子
SELECT
*
FROM
nav_foreign_port_view
WHERE
country_code IN (SELECT DISTINCT
country_code
FROM
carrier_regions cr,
carrier_region_associate cra
WHERE
SCAC = 'SUDU'
AND cra.region_id = cr.region_id)
ORDER BY city_name ASC , country_name ASC;
当我运行它,我得到的消息
Error Code: 1054. Unknown column 'country_code' in 'IN/ALL/ANY subquery'
然而,当我运行在子查询本身它工作正常。
这是怎么回事?
“nav_foreign_port_view”中的“country_code”?我想不是。 – roymustang86