0

I have 4 tables and i want to fetch single customer's booking Record.

TABLE1 (Service_ID  Tax_ID  Cat_ID  S_Name  S_Price)

TABLE2( Order_ID Order_Type Order_Date   Customer_ID     Booking_Type    Booking_Status  Order_No  Car_No)

Table3  (  ID   Order_ID    Service_ID)

Table4(Time_ID  Date_ID Time    Is_Book   Customer_ID     Booking_Status)
4

1 回答 1

0

我想你可以只用JOIN所有的桌子

SELECT *
FROM TABLE2 a 
INNER JOIN TABLE3 b
ON a.Service_ID = b.Service_ID
INNER JOIN TABLE4 c
ON b.Customer_ID = c.Customer_ID
INNER JOIN TABLE1 d
ON b.Service_ID = d.Service_ID
WHERE d.Customer_ID = ?
于 2013-06-19T22:41:09.120 回答