【发布时间】:2012-01-07 16:12:21
【问题描述】:
这里有两张表:
表1
cm_id cost
1 6.52
2 16.52
3 2.12
4 7.14
5 19.09
6 11.52
7 0.12
表2
um_id order_num name
1 517 tommy
2 518 bobby
3 519 scotty
4 520 faris
5 521 justine
6 522 sadie
7 523 nicole
cm_id 和 um_id 代表同一个东西,因此成本可以与每个订单号绑定,即
SELECT table1.cm_id, table1.cost, table2.order_num, table2.order_num
FROM table1, table2
WHERE table1.cm_id=table2.um_id;
我可以使用哪条 SQL 语句从 table1 中删除 table2 中 order_num 介于 518 和 520 之间的行?
【问题讨论】:
-
我相信这应该answer your question。只需使用连接。
-
感谢您的参考,我还有很多事情要做!