问题描述
这是代码,但是当我在开头声明位置时,为什么字段列表中的Unknown列l.zipcode出现错误?
从位置l选择l.zipcode,sum(dum.tab),
(在预订b,位置l中选择count(Pickup_location)作为选项卡,其中b.pickup_location = l.Zip_Code
从booking_destinations的bd内部联接位置l选择bd.destination = l.Zip_Code的联合选择count(destination)作为选项卡,其中bd.sequence in(1,2,3)
从booking_destinations bd,位置l处的union中选择count(destination)作为选项卡,其中bd.destination = l.Zip_Code,序列= 4
)作为dum,其中l.zipcode = 18953;
我尝试过的事情:
我曾尝试在sql语句的开头删除位置
This is the code but why is there an error of Unknown column l.zipcode in field list when i declare location at the beginning?
select l.zipcode,sum(dum.tab) from location l,
(select count( Pickup_location) as tab from booking b,location l where b.pickup_location = l.Zip_Code
union select count(destination) as tab from booking_destinations bd inner join location l on bd.destination = l.Zip_Code where bd.sequence in(1,2,3)
union select count(destination) as tab from booking_destinations bd,location l where bd.destination = l.Zip_Code and sequence = 4
) as dum where l.zipcode = 18953;
What I have tried:
i have tried removing location at the beginning of sql statement
推荐答案
这篇关于字段列表中的未知列l.zipcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!