Are the posted questions getting worse?

  • I am not that fat and ugly...;-)

    I think..:-D

    -Roy

  • GilaMonster (6/19/2009)


    Jeff Moden (6/18/2009)


    Apologies to all... I got the SUM() OVER thing exactly backwards. PARTITION BY is the only part of the OVER clause that can be used. What I'd like to see is the best of both worlds on such aggregates. If you only do a PARTITION BY, have it work the way it currently works... a single total for all rows returned for that partition split for any given query. Barry was correct. The thing that's missing is the ORDER BY part and I'd like to see it do a running total if the ORDER BY were used.

    I think a bit more than just ORDER BY would be needed. Some of the things Itzik discusses (and this is just example syntax) is the ability to specify over what portion of the window the aggregate should run over, controlled by the order by.

    So, some examples of this:

    SUM(SomeValue) OVER (PARTITION BY GroupingValue ORDER BY SomeDate BETWEEN Unbounded Below and Current Row) -- A standard running total

    SUM(SomeValue) OVER (PARTITION BY GroupingValue ORDER BY SomeDate BETWEEN Current Row and Unbounded Above) -- The opposite way around

    AVG(SomeValue) OVER (PARTITION BY GroupingValue ORDER BY SomeDate BETWEEN Current Row -2 and Current Row +2) -- A rolling average over 5 rows

    etc...

    I agree... that would be much more useful.

    --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)

  • Steve Jones - Editor (6/19/2009)


    Now THAT put a smile on my face this morning. Apparently I'm not the only one that has bad days. I'll have to bring that up next week to Phil.

    Heh... cool... maybe a little head boiling will get him to fix the code windows for IE? 😛

    --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)

  • Roy Ernest (6/19/2009)


    I am not that fat and ugly...;-)

    I think..:-D

    Fat and ugly or cute and cuddly??

    -- You can't be late until you show up.

  • Roy Ernest (6/19/2009)


    Paul White (6/19/2009)


    Kit G (6/19/2009)


    Kermit the Frog?

    Win.

    lol... You both cracked me up.... 😀

    Getting a splitting headache?

    😀



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Roy Ernest (6/19/2009)


    Tonight our office is arranging a bowling night for everyone. We had to create teams and our team decided to take the name "Jedi Counsel" and they have given me a Nick Name. The nick Name reminded me of someone green here... 😉

    Has to be "Yoda".

  • Another week, another few hundred posts to read through. At least we found out Roy isn't as fat as Jabba the Hut and Barry isn't a lawyer.

    I spent the last 3+ days working like a dog cleaning out my in-laws house, 7 trips to the dump, 4 trips to a church yard sale, and 3 trips by the auctioneer got rid of most of the stuff. Got about 4 more days without internet at the house then I'll be back home and digging back into work, blogging, and writing.

    I'm looking forward to catching up again with some posts on SSC. I miss the problems other people have, I don't miss my own.

  • Lynn Pettis (6/19/2009)


    Roy Ernest (6/19/2009)


    Tonight our office is arranging a bowling night for everyone. We had to create teams and our team decided to take the name "Jedi Counsel" and they have given me a Nick Name. The nick Name reminded me of someone green here... 😉

    Has to be "Yoda".

    Your's was the obvious answer. I was simply trying to get a rise out of Roy with the Jabba reference. 😀

    -- You can't be late until you show up.

  • Lynn Pettis (6/19/2009)


    Roy Ernest (6/19/2009)


    Tonight our office is arranging a bowling night for everyone. We had to create teams and our team decided to take the name "Jedi Counsel" and they have given me a Nick Name. The nick Name reminded me of someone green here... 😉

    Has to be "Yoda".

    And I was just misunderstanding and picking out another green Muppet creation. 🙂

    Besides, I like Kermie, he's cute. :w00t:

    -- Kit

  • jcrawf02 (6/18/2009)


    Tom Brown (6/18/2009)


    I had a short stint working for the marketing manager of a hospitality retailer. He often got free samples of the various offerings of breweries, wine merchants, cider makers etc, which were shared with his staff. Free beer at work - O happy days. 😀

    Pity I couldn't cycle to that job.

    reminding me of college, there was a band named 'Free Beer' that was very popular, for some reason . . .

    ... with the club owners especially, I'm sure.

  • edit: ARRGGHH. Slow response, inadvertant double post. Apologies for padding the post count on the Thread.

    While I'm here, though, it does strike me that the state of medical research in India may be in trouble if the book piracy is any indication of the ethical standards these guys are following. And yes, "kindly go boil your head" is a definite ten.

  • Jeff Moden (6/19/2009)


    Heh... cool... maybe a little head boiling will get him to fix the code windows for IE? 😛

    I admire your persistence.

    And your optimism!

    😛

  • Happy Saturday, everyone

    I appear to have won a year's licence for Quest's Spotlight for Sql Server, after filling in my details at their booth at the SQLBits conference!

    Does anyone here use it?

    ------------------------------------------------------------------------
    Bite-sized fiction (with added teeth) [/url]

  • mazzz (6/20/2009)


    Happy Saturday, everyone

    I appear to have won a year's licence for Quest's Spotlight for Sql Server, after filling in my details at their booth at the SQLBits conference!

    Does anyone here use it?

    Happy Sunday 😉

    Yep, we use it on all our SQL Servers. It's pretty neat - probably the best tool of this sort that I have encountered so far. It doesn't expose everything you can get from every single dynamic view, but it's pretty darn good.

    If you have any specific questions, I'll be happy to help if I can.

    Paul

  • Paul White (6/20/2009)


    mazzz (6/20/2009)


    Happy Saturday, everyone

    I appear to have won a year's licence for Quest's Spotlight for Sql Server, after filling in my details at their booth at the SQLBits conference!

    Does anyone here use it?

    Happy Sunday 😉

    Oops - yes, that too!

    Yep, we use it on all our SQL Servers. It's pretty neat - probably the best tool of this sort that I have encountered so far. It doesn't expose everything you can get from every single dynamic view, but it's pretty darn good.

    Cool - I can see myself getting attached to it, and then management refusing to renew the licence 😛

    If you have any specific questions, I'll be happy to help if I can.

    Paul

    Thanks Paul!

    ------------------------------------------------------------------------
    Bite-sized fiction (with added teeth) [/url]

Viewing 15 posts - 5,866 through 5,880 (of 66,712 total)

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