如何从同一张表中制作多个INNER JOIN
?
我试过了:
SELECT * FROM ___Bookings
INNER JOIN ___Rooms ON ___Bookings.BOO_RoomId=___Rooms.ROO_Id
INNER JOIN ___Kardex AS ka ON ___Bookings.BOO_ClientId=ka.___Kardex.KDX_Id
INNER JOIN ___Kardex AS kb ON ___Bookings.BOO_BillingId=kb.___Kardex.KDX_Id
WHERE BOO_Id=224
错误讯息:
感谢您的帮助。
答案 0 :(得分:1)
ka.___Kardex.KDX_Id
?
ka.KDX_Id
SELECT * FROM ___Bookings
INNER JOIN ___Rooms ON ___Bookings.BOO_RoomId=___Rooms.ROO_Id
INNER JOIN ___Kardex AS ka ON ___Bookings.BOO_ClientId=ka.KDX_Id
INNER JOIN ___Kardex AS kb ON ___Bookings.BOO_BillingId=kb.KDX_Id
WHERE BOO_Id=224