Answers for "sql query to find percentage of null values in a table"

SQL
0

sql query to find percentage of null values in a table

SELECT 100.0 * SUM(CASE WHEN Column1 IS NULL THEN 1 ELSE 0 END) / COUNT(*) AS Column1Percent,
100.0 * SUM(CASE WHEN Column2 IS NULL THEN 1 ELSE 0 END) / COUNT(*) AS Column2Percent,
100.0 * SUM(CASE WHEN Column3 IS NULL THEN 1 ELSE 0 END) / COUNT(*) AS Column3Percent
FROM #perc
Posted by: Guest on April-21-2021

Code answers related to "sql query to find percentage of null values in a table"

Code answers related to "SQL"

Browse Popular Code Answers by Language