我一直收到以下错误
Msg 208, Level 16, State 1, Line 1
Invalid object name 'SOPNUMBE'.
有人可以指出我的错误吗?这是我第一次使用内连接。
我的代码如下:
Select SOPNUMBE, SOPTYPE, DOCDATE,
ORDRDATE, CMPNTSEQ, ITEMNMBR, QUANTITY,
UNITCOST, UNITPRCE, EXTDCOST, XTNDPRCE
From SOP10100
INNER JOIN SOPNUMBE
On SOP10100.SOPNUMBE = SOP10200.SOPNUMBE
答案 0 :(得分:0)
你正在加入一个不存在的表...另外请使用别名来表示可读性。
Select s1.SOPNUMBE, SOPTYPE, DOCDATE, ORDRDATE, CMPNTSEQ, ITEMNMBR, QUANTITY, UNITCOST, UNITPRCE, EXTDCOST, XTNDPRCE
From SOP10100 s1
INNER JOIN SOPNUMBE s2
On s1.SOPNUMBE = s2.SOPNUMBE
你的版本应该是这样的..
Select SOPNUMBE, SOPTYPE, DOCDATE, ORDRDATE, CMPNTSEQ, ITEMNMBR, QUANTITY, UNITCOST, UNITPRCE, EXTDCOST, XTNDPRCE
From SOP10100
INNER JOIN SOPNUMBE
On SOP10100.SOPNUMBE = SOPNUMBE.SOPNUMBE
答案 1 :(得分:0)
我想你想要这个:
Select SOPNUMBE, SOPTYPE, DOCDATE, ORDRDATE, CMPNTSEQ, ITEMNMBR, QUANTITY, UNITCOST, UNITPRCE, EXTDCOST, XTNDPRCE
From SOP10100
INNER JOIN SOP10200
On SOP10100.SOPNUMBE = SOP10200.SOPNUMBE