我對SQL非常陌生,並嘗試使用SQL Server進行多個連接。SQL Multiple Joins返回錯誤'關鍵字'JOIN'附近語法不正確'。'
鑑於
c_slpn
:
"ID Name Age Salary"
'1 Abe 61 140000'
'2 Bob 34 44000'
'5 Chris 34 40000'
'7 Dan 41 52000'
'8 Ken 57 115000'
'11 Joe 38 38000'
c_cust
:
"ID Name City Industry Type"
'4 Comp1 pleasant J'
'6 Comp2 oaktown J'
'7 Comp3 jackson B'
'9 Comp4 Jackson B'
c_ordr
:
"Number order_date cust_id salesperson_id Amount"
'10 8/2/96 4 2 540'
'20 1/30/99 4 8 1800'
'30 7/14/95 9 1 460'
'40 1/29/98 7 2 2400'
'50 2/3/98 6 7 600'
'60 3/2/98 6 7 720'
'70 5/6/98 9 7 150'
我應該找到「列出銷售人員有一個訂單與‘器Comp1’,但下面的腳本拋出一個錯誤:
Line 6 'Incorrect syntax near the keyword 'JOIN'.
查詢:
SELECT *
FROM c_cust
JOIN C_ordr ON C_ordr.cust_id= c_cust.ID
WHERE NAME = 'Comp1'
JOIN c_slpn ON c_slpn.id=c_ordr.cust_id
請幫我......,我卡住了: -P [這是我的第一個問題,我失去的東西]
您正在使用哪兩種_mutually exclusive RDBMS_? – potashin