Sql query i think using rollup or cube???????

  • Still doesn't work...

    10 John A

    10 John1 A

    Mack

    Rock

    40 Silk B

    Mann C

    You have one too many 10 and A, you also miss 20 and 30 in the ids.

  • UPS ya I was missing 20 and 30 ... didn't notice (Thks Remi : ) )

    for the (10,a) pair I SAID the sol is not working... he needs to check the first name too...

    Is his spec doesn't appear but I just wanted to point out that in that case is not working!

     

    SELECT CASE WHEN cnt IS NULL THEN ltrim(str(A.IDRow))WHEN Cnt=1 THEN ltrim(str(A.IDRow)) ELSE '' END AS IDRow, A.FirstName, CASE WHEN B.IDRow IS NULL THEN '' ELSE A.Country END As Country

    FROM #t A LEFT OUTER JOIN @MyTable1 B

    ON A.IDRow=B.IDRow AND A.Country=B.Country

     


    Kindest Regards,

    Vasc

  • The only "easy" way I see of doing this is at the client side. just takes 3 list and an IsInList function... not that hard to code and would probabely run must faster than what the server could do with sub selects.

Viewing 3 posts - 16 through 17 (of 17 total)

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