《SQL 进阶教程》 查找局部不一致的数据

-- 从下面这张商品表里找出价格相等的商品的组合

select * from products p1
LEFT JOIN products p2
on p1.price = p2.price and p1.name > p2.name
where p2.name is not null

posted @ 2019-08-28 19:06  newlangwen  阅读(319)  评论(0编辑  收藏  举报