Help needed on 3 table query

  • I think something like this will do :

    Select T.id, ISNULL(dta.TA, 0) as TA, ISNULL(dtb.TB, 0) as TB from table1 T left outer join

    (Select ida, count(*) as TA from table1A group by ida) dta

    on T.id = dta.ida left outer join

    (Select idb, count(*) as TB from table1B group by idb) dtb

    on T.id = dtb.idb

  • Remi....

    Thanks for the reply.  Your SQL skills go far beyond mine (which is not hard to do).  I am going to have to study this code for awhile to understand what you are trying to do.

    Thanks again.   Russ...

  • HTH... Books online is your best friend now .

Viewing 3 posts - 1 through 4 (of 4 total)

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