Results 1 to 14 of 14
  1. #1
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601

    Unanswered: Non-specific question

    This is a really, really, bizzare question I am posing, and it is really non-specific, but it is really bugging me, so I will ask it anyway (and look like a real fool) . . .

    There is some creative little query, written in T-SQL, that I found on Rudy's site, or through a link from Rudy's site, which proports to produce a result that you would not expect.


    I know I am being really wishy-washy in my description here, but . . .


    . . . maybe the query produced sequential numbers, maybe something else, but I remember the text associated with the query describing how you would not think that this query would work, but it actually does.

    I have this nagging feeling that this creative little query can solve a problem for me, but now that I am looking for it, I can't find it.

    It is not a really big query, only a couple of lines, but I am going crazy trying to find it again.


    Does anyone know of what I am talking-about (event though, it appears, that I don't know what I am talking-about)?

    Thanks.
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Have you tried emailing Mr red silk leiterhosen himself?
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Wouldn't that be like Dorothy approaching the Wizard of Oz?
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I think you are referring to the trick of creating a delimited string within a variable by assigning it to itself in a select statement.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Possibly. Do you have a link to show an example?
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  6. #6
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I have another version that does an update statement on groups of records like this that will twist the mind.

    IF OBJECT_ID('tempDB..#MyTable') is not null
    DROP TABLE #MyTable

    DECLARE @MySentence varchar(100)

    SELECT 'See' as MyWord
    INTO #MyTable
    UNION
    SELECT 'spot'
    UNION
    SELECT 'run'

    SELECt @MySentence = COALESCE(@MySentence,'') + ' ' + MyWord
    FROM #MyTable


    SELECt @MySentence
    Last edited by Thrasymachus; 05-17-10 at 17:46.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  7. #7
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    That's exactly the concept I was referring to.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  8. #8
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by blindman View Post
    That's exactly the concept I was referring to.
    but it's not something that i ever wrote about (i think)

    [offtopic]
    and they are lederhosen, not "leiterhosen", and couldn't possibly be made of silk because leder means leather
    [/offtopic]


    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  9. #9
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Rudy! The red silk goes IN the ledgerhosen!

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  10. #10
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by Pat Phelan View Post
    ...ledgerhosen!
    Some sort of German accounting method, I assume?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  11. #11
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Yes. Enron tried to perfect the method, as I recall.

  12. #12
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Or maybe that is what happened to that Heath guy who played the Joker.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  13. #13
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Ooh....too soon.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  14. #14
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Uff-da! Typos get me into so much trouble!

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •