我想和两张桌子合影,但是我遇到了问题
这是我的sql语法
select * from booking as b,
booking_detail as bd
WHERE bookingId = 9 AND b.bookingId = bd.bookingId
这是我出错了
答案 0 :(得分:1)
为Save
使用别名
b.bookingId = 9
答案 1 :(得分:1)
将联接和别名用作bookinid列,因为该列在两个表中均可用
select * from booking as b join
booking_detail as bd
on b.bookingId = bd.bookingId
WHERE b.bookingId = 9