What's the count?

  • Good question. This was really a mind teaser. Never thought of doing a COUNT for two tables.

  • Well I learned something today. I had no idea you could produce a cross join in that manner.

  • Well, I guessed that it would cross join and got lucky 🙂

    Now I have a new way to do cross joins! Can't wait to kill my server with that one...

    Peter Trast
    Microsoft Certified ...(insert many literal strings here)
    Microsoft Design Architect with Alexander Open Systems

  • Amazing that so many people are unaware of the syntax. Especially since it pre-dates the CROSS JOIN form.

  • I tried the following statement on some existing tables

    select count(*)

    from table1, table2

    to verify the results of the question. As it turns out, with my data set, the query returns the "Arithmetic overflow error converting expression to data type int".

    It should be noted, that depending on your record sets, the count(*) should be replaced with count_big(*) to give the you the correct results.

  • timothy.g.parker (3/31/2010)


    It should be noted, that depending on your record sets, the count(*) should be replaced with count_big(*) to give the you the correct results.

    Ever wonder why there's no SUM_BIG?

Viewing 6 posts - 16 through 20 (of 20 total)

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