聚合函数

  1. select avg(prod_price) AS avg_price from products;
  2. select count(*) as num_cut from customers;
  3. select max(prod_price) AS max_price from products;
  4. select min(prod_price) AS max_price from products;
  5. select sum(quantity) AS items_ordered from orderitems where order_num = 20005;
  6. select sum(quantity * price) AS total_price from orderitems where order_num = 20005;
posted @ 2024-05-29 09:35  肥梁  阅读(13)  评论(0)    收藏  举报