以下是我的表格:
TABLE
我想在这里发生的是制定一个从tblCurrentTransaction检索所有数据的查询。
我的查询:
SELECT room_name, duration_name, price, final_price, check_in, check_out
FROM tblCurrentTransaction,
tblRoomRates,
tblRooms,
tblDuration
WHERE tblRoomRates.room_id = tblRooms.id
AND tblRoomRates.duration_id = tblDuration.id
输出:
它会打印出其他表格中的所有内容。
我想要它只是在tblCurrentTransaction
答案 0 :(得分:0)
我做到了:
SELECT room_name, duration_name, price, final_price, check_in, check_out
FROM tblCurrentTransaction,
tblRoomRates,
tblRooms,
tblDuration
WHERE tblRoomRates.room_id = tblRooms.id
AND tblRoomRates.duration_id = tblDuration.id
AND tblCurrentTransaction.room_rate_id = tblRoomRates.id;