It's not that's inherently dreaded, it just leans itself to a hard to follow one.
It feels like a harder language to refactor than most I use.
As a cheap excuse, I have come to think that 'loving' SQL does require a different mindset.
I think you're spot on that it takes a different mindset. I treat it like a disposable expression of data, not a program. Essentially, I have data in one form, and I need to translate to this form, what is the logical representation of such a transformation?
If the results of an SQL are not as expected, I have no problem rewriting the entire thing rather than doing a "bug fix."
In my experience the "problem" is how detached it is from the underlying computational model. Even more so when you're working with columnar stores, querying Vertica with SELECT FROM WHERE is kind of weird.
Probably it's because I don't have a lot of experience with it, but I feel like I have to EXPLAIN every other query, I'm never confident what I said is what I mean.
> I've wondered sometimes if it's possible to quantify what I hate about hacking SQL so much, but it's hard...
For me, any time I have to write any SQL statements it's the totally and utterly unhelpful error messages: >ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your DB server version for the right syntax to use near <insert really long SQL query>
...which, as far as I can see, haven't changed an iota in their total and utter vagueness since I first wrote an SQL query about 20 odd years ago. >ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your DB server version for the right syntax to use near <insert really long SQL query>
...which, as far as I can see, haven't changed an iota in their total and utter vagueness since I first wrote an SQL query about 20 odd years ago.Heck, we wrote a program at one point that dumped the operation being done by running queries. SQL is so much easier than a lot of other languages.