best possibilities

  • The power function is only calculated for the five fields!

    POWER(0, 2) + POWER(7, 2) + POWER(7, 2) + POWER(0, 2) + POWER(0, 2) is 98

    POWER(9, 2) + POWER(0, 2) + POWER(0, 2) + POWER(5, 2) + POWER(0, 2) is 106

    That's how I get two equal bills before two different bills, for the same amount.

    It is an extension of "least error summation".

    The number of rows are never more than the original rows.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • I'm talking not about POWER from your query.

    I'm talking about 12 rows involved in 5 CROSS JOINs.

    SQL Server will create temp table to hold the result of these joins, and number of rows in this table will be POWER(12,5) = 248832.

    If I could not avoid this table I would consider to make permanent and setup some indexes.

    _____________
    Code for TallyGenerator

  • Ok, now I follow you!

     


    N 56°04'39.16"
    E 12°55'05.25"

  • Fast generic solution posted here

    http://www.sqlteam.com/forums/topic.asp?whichpage=2&TOPIC_ID=73610&#264068

     


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 4 posts - 16 through 18 (of 18 total)

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