我在这里有一个关于SQL的问题,我已经搜索了几个关于'如何将列组合成一列'的网站,并且已经尝试了帮助器中的每个提示但是我做错了,错误声明< / p>
Msg 4104,Level 16,State 1,Line 12
无法绑定多部分标识符“LOT_LOC_BOND.LOT_ID”。Msg 4104,Level 16,State 1,Line 12
无法绑定多部分标识符“LOC_LOT_IEBT.LOT_ID”。Msg 4104,Level 16,State 1,Line 12
无法绑定多部分标识符“LOT_LOC_MBT.LOT_ID”。Msg 4104,Level 16,State 1,Line 12
无法绑定多部分标识符“LOT_LOC_SEAL.LOT_ID”。
这是SQL语句,我使用的是SQL Server 2014:
USE IMS_Location
SELECT TOP(1000)
LOT_LOC_BOND.LOT_ID, LOT_LOC_BOND.CheckIn AS BOND_CheckIn,
LOT_LOC_BOND.CheckOut As BOND_CheckOut,
LOT_LOC_BOND.StatusDesc AS BOND_Status,
LOT_LOC_IEBT.LOT_ID, LOT_LOC_IEBT.CheckIn AS IEBT_CheckIn,
LOT_LOC_IEBT.CheckOut AS IEBT_CheckOut, LOT_LOC_IEBT.StatusDesc AS IEBT_Status,
LOT_LOC_MBT.LOT_ID, LOT_LOC_MBT.CheckIn AS MBT_CheckIn,
LOT_LOC_MBT.CheckOut AS MBT_CheckOut,
LOT_LOC_MBT.StatusDesc AS MBT_Status,
LOT_LOC_SEAL.LOT_ID, LOT_LOC_SEAL.CheckIn AS SEAL_CheckIn,
LOT_LOC_SEAL.CheckOut AS SEAL_CheckOut,
LOT_LOC_SEAL.StatusDesc AS SEAL_Status
FROM
LOT_LOC_BOND
LEFT JOIN
LOT_LOC_IEBT ON LOT_LOC_BOND.LOT_ID = LOT_LOC_IEBT.LOT_ID, LOT_LOC_MBT
LEFT JOIN
LOT_LOC_SEAL ON LOT_LOC_MBT.LOT_ID = LOT_LOC_SEAL.LOT_ID
SELECT
(LOT_LOC_BOND.LOT_ID + LOC_LOT_IEBT.LOT_ID +
LOT_LOC_MBT.LOT_ID + LOT_LOC_SEAL.LOT_ID) AS LOT_ID
ORDER BY
LOT_ID
答案 0 :(得分:0)
你可能要做的就是这个;因为您可能希望合并多列的结果。
您收到错误消息,因为您的SELECT语法错误,因为没有FROM可供选择。
from b import * # swap order of imports breaks Version 1b!
import math