多表SQL例子

SELECT orders.*,items.* FROM orders,orders_items_relation,items WHERE orders.orders_id=orders_items_relation.orders_id AND orders_items_relation.items_id=items.items_id;

SELECT items.* FROM USER,orders,orders_items_relation,items WHERE user.username='张三丰' AND user.user_id=orders.user_id AND orders.orders_id=orders_items_relation.orders_id AND orders_items_relation.items_id=items.items_id;

posted @ 2020-03-05 22:30  尐鱼儿  阅读(95)  评论(0编辑  收藏  举报