Comment On Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

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: [expand full text]
« PrevPage 1 | Page 2Next »

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 12:34 • by Fresh Meat
*sob*

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 12:35 • by JBL
Probably took longer for the server to run the query than it did to write it.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 12:35 • by TankerJoe
These last two posts have made my head explode explode explode explode explode explode explode.


.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 12:35 • by Anonymous
My god. That second screen looks like some massive treasure room in Rogue. Look at all the rings and weapons!

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 12:51 • by Dude
77498 in reply to 77497
if you play the query backwards it's a message from Satan.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 12:53 • by SeeJay

O_o


 


Oh my hat.


 


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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:06 • by Phill


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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:14 • by Jojosh_the_Pi
Give the guy some bonus points for thinking outside the box.  You can't find this stuff in "SQL for Dummies" (I hope).

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:14 • by home homine lupus est
77502 in reply to 77499




THIS one flew over the sql developper.

--Tei

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:19 • by mrsticks1982
77503 in reply to 77499
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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:22 • by mrsticks1982
77505 in reply to 77495

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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:23 • by marvin_rabbit
77506 in reply to 77498
Anonymous:
if you play the query backwards it's a message from Satan.

And forwards too.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:26 • by Sympathetic Coder

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!"


 


 


 

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:28 • by Garo
77508 in reply to 77506
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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:28 • by tufty
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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:29 • by GoatCheez
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:



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.



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.


Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:32 • by Tim
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?

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:37 • by Jeff S
77513 in reply to 77511
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 .....

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:45 • by Volmarias
77514 in reply to 77513
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?

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:48 • by notromda
77515 in reply to 77511
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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:49 • by Raymond Chen
It could be worse. At least they called it strEmailAddress. They could've called it strJobTitle.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 13:54 • by Volmarias
77518 in reply to 77514
Well, at the least, here's Hello Cthulhu

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 14:04 • by Randyd
77520 in reply to 77515

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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 14:06 • by jspenguin
Alex Papadimoulis:


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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 14:11 • by Harsh
77524 in reply to 77503
 
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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 14:14 • by Kud
77525 in reply to 77498

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



That's nothing. If i play it forward, it makes my head expl...[Disconnected]

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 14:24 • by Jelmer
77526 in reply to 77498
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 

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 14:27 • by Bullet
77527 in reply to 77498

paul is dead miss im miss im


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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 14:32 • by SeeJay
77528 in reply to 77503

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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 14:57 • by zamies
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.







Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:11 • by John Bigboote
I'll be right back, I have to go wash my eyes out with acid.



Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:28 • by Mikademus
77534 in reply to 77526
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!

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:29 • by ParkinT
Jake deserves a medal for even *touching* this long enough to get it posted on TDWTF!!

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:31 • by Trinian
Oh man... I think I'm gonna throw up...

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:34 • by BBFire
77537 in reply to 77508
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!

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:40 • by masklinn
77538 in reply to 77521
jspenguin:
Alex Papadimoulis:


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

Lisp programs are usually indented and somewhat readable though.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:40 • by Dazed
77539 in reply to 77528
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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:41 • by Doug
77541 in reply to 77536
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)

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:42 • by Gabe
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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 15:58 • by Junior IT Professional
I am crying for you Jake.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 16:06 • by Doug
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!)

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 16:43 • by Adam
I am not going to burn 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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 16:47 • by Indrek
Woah, this is what Jake's previous post mentioned as "beautifully written, well-commented ASP"? THIS?

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 16:52 • by tmountjr
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:

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 17:01 • by WHO WANTS TO KNOW?

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

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 17:02 • by An apprentice

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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 17:02 • by jo42

Ahhghfphflt!


Brain. Failed. To. Parse.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 17:10 • by lizardfoot
networkingJoin = "(((((((((((((((((Cn LEFT JOIN CnAdr ON....

Step 1: Remove one parenthese
Step 2: Walk away quietly.
...
Step 3: Hilarity ensues





Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 17:12 • by JR
77560 in reply to 77542

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.

Re: Classic WTF - How To Query "Pointless Pointless Pointless Pointless Pointless Pointless Pointless"

2006-06-14 17:26 • by gdn
77565 in reply to 77509
I suppose the database is MS Access and therefore brackets in join clause are necessary.
« PrevPage 1 | Page 2Next »

Add Comment