• Fresh Meat (unregistered)

    sob

  • (cs)

    Probably took longer for the server to run the query than it did to write it.

  • (cs)

    These last two posts have made my head explode explode explode explode explode explode explode.


    .

  • Anonymous (unregistered)

    My god. That second screen looks like some massive treasure room in Rogue. Look at all the rings and weapons!

  • Dude (unregistered) in reply to Anonymous

    if you play the query backwards it's a message from Satan.

  • SeeJay (unregistered)

    O_o

     

    Oh my hat.

     

    I will never, ever complain about the WTF-ery code that I have to work with after seeing this.

  • (cs)

    That is pure insanity.... There are some WTFs that are inexcusable and downright stupid but that...
    That is when you clear your desk and walk out the door; to hell with the breach-of-contract law-suit.
    Simply claim irreconcilable differences… all the rage in celebrity marriages these days.

  • (cs)

    Give the guy some bonus points for thinking outside the box.  You can't find this stuff in "SQL for Dummies" (I hope).

  • home homine lupus est (unregistered) in reply to SeeJay
    [image]
    THIS one flew over the sql developper.

    --Tei

  • (cs) in reply to SeeJay
    Anonymous:

    O_o

     

    Oh my hat.

     

    I will never, ever complain about the WTF-ery code that I have to work with after seeing this.

     

    liar ... that is not possible, venting must occur everyday at 5pm

  • (cs) in reply to JBL

    JBL:
    Probably took longer for the server to run the query than it did to write it.

    I could see the manual ...

    step 1: Click on Button X

    step 2: take a half hour walk .. the results may or may not be there. But if the server crashes because of you clicking Button X you are Fired!

    step 3: Have fun and enjoy your brief stay with us at Initech.

  • (cs) in reply to Dude
    Anonymous:
    if you play the query backwards it's a message from Satan.

    And forwards too.
  • Sympathetic Coder (unregistered)

    You know, the bright side of this, you can show the screenies from today and yesterday, and regardless of the tech savvy of your boss, probably get an ok for a complete redesign of the database and little pestering for a while.

     

      The ignorant will wince, and run away from reading the babble, while the knowledgeable will wince, and attempt to "kill it! Kill it with flame!"

     

     

     

  • Garo (unregistered) in reply to marvin_rabbit

    Oh my god! I have watched this site for a while, but until now I didn't find anything so wtf what would justificate posting this "omg" posting here.

      - Garo

  • (cs)

    To be honest, I can't see a sane way of querying the abortion of a database "design" without doing all that.

    At least the gnarly join is being reused / separated out for reuse.  Not sure all the brackets are necessary, but hey.  Presumably they are all left joins because any or all of them can return null.

    It's about how I envisaged it, having seen the previous WTF, to be honest.  Better, in fact;  I was expecting it to look more like this:


    select ......
    from Cn, CnAdr .... etc etc
    where Cn.CnAdr_LINK = CnAdr.CnAdr_LINK and ....


    In fact, I wouldn't have bet money against all the join columns being converted to strings before the comparisons.

    On the other hand, how someone who knows what a "join" clause means could write this without screaming in pain, and then refactoring the whole thing, boggles me.

    Simon

  • (cs)
    Alex Papadimoulis:

    I know that Jake said I'd post some fresh content today, but it just didn't seem right to revisit Pointless Pointless Pointless Pointless Pointless Pointless Pointless without revisiting how such an innovative database is queried. So, once again, let's turn it over to Jake:

    This is the query we use to find a record in the database:

    [image]

    Email addresses are in the phone number field.  Website URLs are in the other phone number field.  This reminds me of my brief stint helping out after school at a hospital.

    "Doctor, where should I put the penicillin we ordered?"

    "In the box marked 'EXPLOSIVE DEADLY CANCER POISON.'"

    "Oh... kay... And the shipment of explosive deadly cancer poison?"

    "Jesus, do I have to do everything myself?  It's very dangerous stuff, so we keep it in the freezer at the cafeteria and write 'FOOD' on the side.  Here's a marker."

    Keen-eyed readers may've noticed where it says "networkingFromClause" in the above screenshot.  Why not just type out "FROM Cn"?  This next screenshot will clarify things.

    [image]

    Ha ha, you suckers thought that would actually clarify things!  MAN you should see the looks on your faces!

    I know what you're thinking, but views are absolutely out of the question.  Just because.

    Now, if you'll excuse me, I'll resume weeping quietly at my desk.



    Uhba debhada. Dashbidiboo da decklo shup. Reftinda kloptos abidi weng jehn! Dashnaka jibidenk, deb dlorpa jib.

    *whack*
    *bang*
    *thud*

    Oh, geez... what happened... oh, I was readding today's wtf... ok, uhh....

    ... next screenshot.... clarify things.... networkingJoin = ....

    *fizzle*

    Error: Mass system failure. Please restart brain.


  • Tim (unregistered)

    Oh man, I worked for those DBAs. They would NEVER let you add a new field. Apparently something wrong with postgresql and alter statements (although nothing I ever found in the postgres docs, and nothing I could replicate on a local dev database). Just use the current table. Oh hey, we have a field called billing_code free. Would that work for your email address? They also liked to have really short fields, because we all know that first names are 10 characters long, right?

  • (cs) in reply to Tim

    Reminds me of one of the databases I inherited recently.

    The entity table for the properties that we manage contains a column called "Region", which is a nice FK to the Region table.  So far so good.   But then I noted another column on the Properties table, also a FK to the region table, called: "Real Region".  

    And, of course, the two columns had differing values .....

  • (cs) in reply to Jeff S

    I never knew what it meant to "gibber" until I read this column. The title of the H.P. Lovecraft story "At the Mountains of Madness" fits pretty perfectly for today and yesterday.

    Where's my shoggoth smiley?

  • (cs) in reply to Tim
    Anonymous:
    Oh man, I worked for those DBAs. They would NEVER let you add a new field. Apparently something wrong with postgresql and alter statements

    You know, I ran into someone like that on IRC the other day... Basically claimed that altering tables was unecessary because once the design is set, you shouldn't have to change it.

    I guess some people never make mistakes? Never have the customer change their mind. yeesh.

  • (cs)

    <FONT face=Arial size=2>It could be worse. At least they called it strEmailAddress. They could've called it strJobTitle.</FONT>

  • (cs) in reply to Volmarias

    Well, at the least, here's Hello Cthulhu [image]

  • Randyd (unregistered) in reply to notromda

    notromda:
    Anonymous:
    Oh man, I worked for those DBAs. They would NEVER let you add a new field. Apparently something wrong with postgresql and alter statements
    You know, I ran into someone like that on IRC the other day... Basically claimed that altering tables was unecessary because once the design is set, you shouldn't have to change it. I guess some people never make mistakes? Never have the customer change their mind. yeesh.

     

    Two ways to think about it, one is that you should always be prepared to modify the schema, but at a cost (usually high) and two, if done correctly, a schema should be tolerant to additional idea without the need for modification - i.e. the changes are data, not metadata.

    that being said, most database designs I have seen are neither.  They all desperately want to be reworked.

  • (cs)
    Alex Papadimoulis:

    Looks like some of the Lisp programs I've seen.

  • (cs) in reply to mrsticks1982

     

    mrsticks1982:
    Anonymous:

    O_o

     

    Oh my hat.

     

    I will never, ever complain about the WTF-ery code that I have to work with after seeing this.

     

    liar ... that is not possible, venting must occur everyday at 5pm



    I usually vent all day on web sites while being paid to do work.
  • (cs) in reply to Dude
    if you play the query backwards it's a message from Satan.
    								</div></BLOCKQUOTE><br>That's nothing. If i play it forward, it makes my head expl<font face="Times New Roman">...[Disconnected]</font><br>
    
  • Jelmer (unregistered) in reply to Dude
    Anonymous:
    if you play the query backwards it's a message from Satan.


    If you play it forward it's a message from satan just the same 
  • (cs) in reply to Dude

    paul is dead miss im miss im

    Anonymous:
    if you play the query backwards it's a message from Satan.

  • SeeJay (unregistered) in reply to mrsticks1982

    mrsticks1982:

    liar ... that is not possible, venting must occur everyday at 5pm

     

    I make it home by 5 pm, so my venting at bad code is done by then. 

    I did do a lot of venting on a mailing list about the total bass-ackwards code I inherited that was written in ColdFusion by someone who doesn't even remotely qualify as a programmer.  I've been rewriting the website in ASP and somehow managed to compile a batch of 20 pages (and over 5000 lines of "code") into 4 pages and 400 lines. 

    I've since given up venting about it.  I just sigh, hang my head, and plug on, content in the fact that while I've never really considered myself a "programmer", I'm Bill-Bloody-Gates compared to this weeniemaster.

    (BWA HA HA!  I just scrolled down to hit the captcha test and the word there is "billgates"!  No word of a lie, I didn't even see that until I wrote the above!  Hee!  I amuse me!)

  • (cs)

    I wonder how much money they spend on maintenance cost.
    Looks like this one evolved from a little WTF over the years to become a MONSTER WTF.



  • (cs)

    I'll be right back, I have to go wash my eyes out with acid.

  • (cs) in reply to Jelmer
    Anonymous:
    Anonymous:
    if you play the query backwards it's a message from Satan.


    If you play it forward it's a message from satan just the same 


    Lol, like the Two Stooges of forum posts!
  • (cs)

    Jake deserves a medal for even touching this long enough to get it posted on TDWTF!!

  • Trinian (unregistered)

    Oh man... I think I'm gonna throw up...

  • (cs) in reply to Garo
    Anonymous:
    Oh my god! I have watched this site for a while, but until now I didn't find anything so wtf what would justificate posting this "omg" posting here.

      - Garo


    Amen to that!
  • (cs) in reply to jspenguin
    jspenguin:
    Alex Papadimoulis:

    Looks like some of the Lisp programs I've seen.

    Lisp programs are usually indented and somewhat readable though.

  • Dazed (unregistered) in reply to SeeJay
    Anonymous:

    I did do a lot of venting on a mailing list about the total bass-ackwards code I inherited that was written in ColdFusion by someone who doesn't even remotely qualify as a programmer.  I've been rewriting the website in ASP and somehow managed to compile a batch of 20 pages (and over 5000 lines of "code") into 4 pages and 400 lines. 

    Too familiar. I took over one that was 20Mb of 50-times copy-and-pasted Javascript and text-as-images. It was under 2Mb by the time I finished. But let's not complain - at least there are some people out there who are prepared to invest time and money in producing something maintainable.

  • Doug (unregistered) in reply to Trinian

    Let's try that again ...

    Anonymous:
    Oh man... I think I'm gonna throw up...


    I already did.

    --Doug (trying for his own WTF by not comprehending how to properly respond)

  • Gabe (unregistered)

    It's a good thing they weren't running on SQL Server 6.5 or earlier. It had a limit of 16 tables in a query (including those from views), and I count something like 20. Of course 6.5 didn't have ANSI join syntax, so it would have been shorter with *= instead of LEFT JOIN.

  • (cs)

    I am crying for you Jake.

  • Doug (unregistered)
    Alex Papadimoulis:

    I know what you're thinking, but views are absolutely out of the question.  Just because.



    You think you're funny.  That's the concensus where I'm employed.

    Oh, and Security said no Hibernate b/c the app may core dump and reveal sensitive information.

    What is the smiley for crying/weeping?  Google says this:

    :'-(


    CAPTCHA Test:  jiggles   (that's hot!)
  • Adam (unregistered)

    <font face="Verdana" size="2">I am not going to <font color="#ff0000">burn</font> anyone else's brain by making them see any of this any more.

    Just be thankful that there are still people in the world who do write like this.  They keep those of us who are professional gainfully employed at good rates....


    CAPTCHA Test: null
    </font>

  • Indrek (unregistered)

    Woah, this is what Jake's previous post mentioned as "beautifully written, well-commented ASP"? THIS?

  • (cs)

    Back! Back, ye demon schema from hell! Go back to the flames from whence ye come!

    :waves cross-shaped necklace around a la The Exorcist:

  • WHO WANTS TO KNOW? (unregistered)

    The code DOES look similar to what I thought it would be like, but WHY do they have to link EVERYTHING?   They should only link what they use.  And YEAH, the idea of misnaming fields is bad.  SAPs ideo of generic names, or sequentially named fields is even probably better.  And the parenthesis aren't needed.

    Steve

  • An apprentice (unregistered)

    That's just what you get for adopting 'one table to join them all' approach. I don't think the query is a major WTF in itself, but rather a logical result of the totally insane database structure. Apart from the 'no views' argument, it seems there is no easy way to query this heap of randomly connected tables.

    So, it's easy to say some people should be prevented from using a database at all. But then they would revert to xml or flat-text, much more wtf-ish. At least there are tools for refactoring a faulty db design. So we should be grateful, it could have been worse.

  • (cs)

    Ahhghfphflt!

    Brain. Failed. To. Parse.

  • (cs)

    <font color="#000000"><font face="Courier New"><font size="2">networkingJoin = "(((((((((((((((((Cn LEFT JOIN CnAdr ON....

    <font face="Times New Roman" size="3">Step 1: Remove one parenthese
    Step 2: Walk away quietly.
    ...
    Step 3: Hilarity ensues


    </font>
    </font>

    </font></font>

  • JR (unregistered) in reply to Gabe

    Anonymous:
    It's a good thing they weren't running on SQL Server 6.5 or earlier. It had a limit of 16 tables in a query (including those from views), and I count something like 20. Of course 6.5 didn't have ANSI join syntax, so it would have been shorter with *= instead of LEFT JOIN.

    6.5 does have ANSI joins.

  • gdn (unregistered) in reply to tufty

    I suppose the database is MS Access and therefore brackets in join clause are necessary.

Leave a comment on “Classic WTF - How To Query &quot;Pointless Pointless Pointless Pointless Pointless Pointless Pointless&quot;”

Log In or post as a guest

Replying to comment #77505:

« Return to Article