select * from purchases where product_id = any(1,3);
select * from purchases where product_id in (1,3);
本文介绍了两种使用SQL查询特定产品购买记录的方法:一种是使用ANY子句,另一种是使用IN子句。这两种方法均可从purchases表中选取product_id为1或3的记录。
select * from purchases where product_id = any(1,3);
select * from purchases where product_id in (1,3);
1443

被折叠的 条评论
为什么被折叠?