标签:div spl ice rod bsp 表达式 view sel code
SELECT SUM(CASE WHEN sale_price <= 1000 THEN 1 ELSE 0 END) AS low_price, SUM(CASE WHEN sale_price BETWEEN 1001 AND 3000 THEN 1 ELSE 0 END) AS mid_price, SUM(CASE WHEN sale_price >= 3001 THEN 1 ELSE 0 END) AS high_price FROM Product;
SQL基础教程(第2版)第6章 函数、谓词、CASE表达式:练习题
标签:div spl ice rod bsp 表达式 view sel code
原文地址:https://www.cnblogs.com/MarlonKang/p/12233003.html