Counting results of TSQL

  • Hi All,

    I have an sql as follows:

    select count(*) from Split1 st1 full outer join split2 st2 on st1.Letter =st2.Letter

    where (st1.Letter is null or st1.Letter is null )

    I need to get the number of null values in each column.

    Please note that i can't write sql in 2 lines as this is referencing a CTE above it and as you know you can only reference a CTE in the next line only, i didn't write previous code to simplify things.

    In example i attached, i need the count of nulls in first column which is 1 and count of nulls in 2nd column which is 2 not 3 which is the total of both.

    Then i will use the 2 counts to get the bigger of them, so in above example i should return 2.

    Thanks

    Nader

  • Never mind i was able to solve it.

    Thanks

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply