Mysql SQL函数错误
我是MySQL的新手,正在使用MySQL处理一个基于订购系统的项目 我要的是一张桌子:Mysql SQL函数错误,mysql,function,Mysql,Function,我是MySQL的新手,正在使用MySQL处理一个基于订购系统的项目 我要的是一张桌子: Session Table: PK Session_ID Date: Session_Date Delivery Table: PK: Del_Type (eg. Firstclass, Secondclass) Int: Del_TimeToDeliver (1, 2, 3, these represent the expected time to deliver) Order Table: PK:
Session Table:
PK Session_ID
Date: Session_Date
Delivery Table:
PK: Del_Type (eg. Firstclass, Secondclass)
Int: Del_TimeToDeliver (1, 2, 3, these represent the expected time to deliver)
Order Table:
PK: Order_ID: autonum + 1
FK: Order_Delivery_ID
Date: Order_EstDelivery
我想添加一个订单,根据会话ID计算估计的时间,基本上是:
Order_EstDelivery = (Session Date + Delivery_TimeToDeliver)
我有这个密码:
INSERT INTO rbickers.order(Del_Type, Order_EstDelivery)
SELECT Del_Type, Ses_Date + INTERVAL Del_TimeToDeliver DAY
FROM Session
LEFT JOIN rbickers.delivery ON Del_Type = ("SecondClass")
WHERE Ses_ID = 2
但它在字段列表中的未知列“Del_Type”上返回了一个错误
我不理解这个错误。据我所知,订单表中不存在Del_Type列。不能向表架构中不存在的列插入值
INSERT INTO rbickers.order(Del_Type, Order_EstDelivery)
“Session”表不包含“Del_Type”列,因此不能对其运行“Join”