Forum Replies Created

Viewing 15 posts - 32,521 through 32,535 (of 59,099 total)

  • RE: Nested While loop

    Sean Lange (9/21/2011)


    venoym (9/21/2011)


    I think Jeff might roll over and die if he saw either of us using his setbased splitter as the source of a cursor. :w00t:

    Heh... nope... loading...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    SQL Kiwi (9/20/2011)


    Jeff Moden (9/20/2011)


    Hmmm... based on our previous conversation, why didn't you include an ORDER BY in this particular example?

    Just forgot. I used one in my final example...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    Jeff Moden (9/20/2011)


    SQL Kiwi (9/17/2011)


    daveriya (9/16/2011)


    i have one column in which i need to do sum for every id and then i need to do total of that sum.is ther...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    SQL Kiwi (9/17/2011)


    daveriya (9/16/2011)


    i have one column in which i need to do sum for every id and then i need to do total of that sum.is ther any function...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    daveriya (9/19/2011)


    thank you everybody ,i got my solution ,

    but just one prob ,coz of to do total i ignore --having SUM(NULLIF(BOOK,0 )) is not null,what is the alternative of...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Query optimizing 2

    Thanks,

    Try this... it's a technique called "Pre-Aggregation" (phrase coined by Peter Larsson). It usually runs quite a bit faster than many straight forward Cross-Tab methods and is a bit...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Please help me out this question?

    Thanks, Perry. :blush:

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Hierarchical Dataset using a Self-Referencing Table

    Thank you for the great feedback, Howard.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: An alternative to GUIDs

    nick 2435 (9/15/2011)


    We changed the SO numbering here to be a long set of letters and numbers that are part random and part sequence (based on time) which means the...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    That's part of it but I agree... it's doesn't explicity state a given order so we'll leave it where it lays.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    SQL Kiwi (9/19/2011)


    Do you have a reference for this 'certain order'?

    I do. As a matter of fact, it's in the link you posted.

    Try this:

    SELECT

    e.id,

    SUM(e.amount) AS id_sum,

    SUM(SUM(e.amount)) OVER () AS...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    SQL Kiwi (9/18/2011)


    Jeff Moden (9/18/2011)


    "Unordered"... have you an example of when ROLLUP produces incorrectly ordered results?

    I don't need one: presentation order is never guaranteed unless there is an outer-scope ORDER...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Please help me out this question?

    Perry Whittle (9/18/2011)


    Jeff Moden (9/18/2011)


    This is just so wrong... What is the name of the school where they are teaching you to do such a thing in SQL Server?

    RBARs R...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    "Unordered"... have you an example of when ROLLUP produces incorrectly ordered results?

    Also, what do you mean by it not taking us "very far forward"? unless I'm misunderstanding the requirements...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: total of sum

    daveriya (9/17/2011)


    YA LIKE THIS,BUT CAN WE USE SUM(SUM(FIELD)) ????

    Just so you know, all caps in your posts is frequently identified as yelling at someone. I recommend avoiding the use...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 15 posts - 32,521 through 32,535 (of 59,099 total)