You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT
product_status,
(
sum( CASE WHEN product_price >= 0 AND product_price < 10 THEN 1 ELSE 0 END )) AS 0_10,
(
sum( CASE WHEN product_price >= 10 AND product_price < 20 THEN 1 ELSE 0 END )) AS 10_20,
(
sum( CASE WHEN product_price >= 20 AND product_price < 30 THEN 1 ELSE 0 END )) AS 20_30,
(
sum( CASE WHEN product_price >= 30 THEN 1 ELSE 0 END )) AS other
FROM
product
WHERE
product_id IN (
SELECT
product_id
FROM
category_product
WHERE
category_id = ( SELECT category_idFROM category WHERE category_name= 'Shoes' ))
GROUP BY
product_status;
product表
product_id
product_status
product_price
category表
category_id
category_name
product_category表
product_id
category_id
找出品类为
Shoes
的产品,运行sql得出如下结构的数据 第一行为价格范围The text was updated successfully, but these errors were encountered: