温馨提示×

Oracle的BETWEEN在实际应用中的案例

小樊
82
2024-07-19 10:21:42
栏目: 云计算

  1. 查询某个时间段内的销售数据
SELECT *
FROM sales
WHERE sale_date BETWEEN '2021-01-01' AND '2021-12-31';
  1. 查询某个价格范围内的产品信息
SELECT *
FROM products
WHERE price BETWEEN 10 AND 50;
  1. 查询某个年龄段的客户信息
SELECT *
FROM customers
WHERE age BETWEEN 18 AND 30;
  1. 查询某个数量范围内的库存信息
SELECT *
FROM inventory
WHERE quantity BETWEEN 100 AND 500;

0