SQL Subqueries
Subject:   Subquery
Date:   2006-04-01 05:21:25
From:   rooman
i want to count comm col in emp table.there are some NULL values.i want my screen to show me two columns ,one telling me the count on NULL values and the other on NOT NULL values.
Full Threads Newest First

Showing messages 1 through 2 of 2.

  • Subquery
    2006-04-05 21:18:52  paul21_7 [View]

    COUNT(SELECT 1 FROM emp WHERE comm IS NULL) AS null_count,
    COUNT(SELECT 1 FROM emp WHERE comm IS NOT NULL) AS not_null_count
    FROM dual

    • Subquery
      2006-06-21 00:49:04  JustQuery [View]

      select Count(comm) null_count,count(*)-count(comm)not_null_count from emp