EADST

Calculate the Ratio with CASE WHEN in SQL

Here is the SQL sentence to calculate the ratio with the case when.

SELECT sku, SUM(CASE WHEN sales_qty='None' THEN 1 END)*1.00/SUM(1)
FROM table
GROUP BY sku;

相关标签
SQL
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文242篇,共被浏览290263

本站已经建立1778天!

热门文章
文章归档
回到顶部