INNER JOIN(SELECT FROM WHERE)返回错误:字段列表中的未知列

时间:2019-06-26 06:26:43

标签: mysql mysql-workbench

根据我的内部联接,列是未知的

  

错误代码:1054。“字段”中的未知列“ storage_rates.s_rate”   列表”

select 
    entry_id,
    contr_list.contr_no,  
    contr_type.type_code,
    storage_rates.s_rate
from entry_list
left join contr_list 
    on contr_list.contr_id = entry_list.contr_id
left join contr_type 
    on contr_type.type_id = contr_list.contr_type_id
inner join (SELECT contr_type_id FROM storage_rates WHERE rate_stat = 1) s 
    on s.contr_type_id = contr_type.type_id;

基于内部联接的storage_rates.rate_stat = 1,预期输出为storage_rates.s_rate =

0 个答案:

没有答案