字段列表中的未知列l.zipcode [英] Unknown column l.zipcode in field list

查看:345
本文介绍了字段列表中的未知列l.zipcode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是代码,但是当我在开头声明位置时,为什么字段列表中的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

推荐答案

要求很明显,但是位置表中是否包含名为zipcode的列?在sql的其他地方使用zip_code.
Asking the obvious but does the location table have a column called zipcode? Elsewhere in the sql you use zip_code.


这篇关于字段列表中的未知列l.zipcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆