【发布时间】:2016-07-26 22:49:06
【问题描述】:
我有两张桌子:
-
booking- 记录订单详情id | booking_amount ------------------- 1 | 150 2 | 500 3 | 400 -
payment- 记录订单付款id | booking_id | amount ------------------------ 1 | 1 | 100 2 | 1 | 50 2 | 2 | 100
我想查找所有未完成付款的预订。根据上述数据,我们预计答案是2,3,因为booking_id=1 的支付总和与booking_table 中对应的booking_amount 匹配。
【问题讨论】:
-
我不明白你到底想要什么。你的答案是 2,3?
-
请再次检查我的问题我已添加截图
标签: mysql sql join inner-join