HNHacker News
TopNewBestAskShowJobs

regexman1

108 karma · joined September 25, 2024

submissionscomments
regexman1··on Show HN: How much of Hacker News is AI?
Brilliant
regexman1··on SQL Tips and Tricks
I'm an analyst so I literally only query for analytical purposes. I don't have any SQL code embedded in an application so the 1=1 is purely for tweaking/testing a query more quickly.

I certainly didn't use AI, all these tips/tricks are from work experience and reading Snowflake documentation and the like, but I guess I can't convince you either way. Regardless I appreciate the feedback!

regexman1··on SQL Tips and Tricks
I've amended the README.md to explain what I meant. My error was in using the word dynamic!
regexman1··on SQL Tips and Tricks
Just to be clear I'm using it for the same reason as trailing commas.

If I'm inspecting a dataset I use WHERE 1=1 so I can add and remove conditions more easily.

I realise the confusion is in my wording of dynamic - I might amend the README.md to clarify. Thanks for the feedback!

regexman1··on SQL Tips and Tricks
That's right - it's just a quicker way of being able to comment/uncomment conditions when doing EDA or debugging.
regexman1··on SQL Tips and Tricks
Not at all actually, I just hadn't really planned to add this as a tip. Additionally I thought an in-line view was fine for the examples included. But maybe I will!
regexman1··on SQL Tips and Tricks
Fair point!
regexman1··on SQL Tips and Tricks
I appreciate the feedback, no offence taken. I'm an analyst so I often find the leading comma useful when I'm testing something and want to quickly comment a column out but I take your point.

And I agree, I should have used CTEs for this query, I was just trying to save lines of code which had the unintended consequence of quite an ugly query. However I did want to use it as an example of indentation being useful to make it slightly easier to read. Although perhaps I'm the only one who thinks so.

I greatly appreciate the constructive criticism.

regexman1··on SQL Tips and Tricks
That's a totally valid point haha.
regexman1··on SQL Tips and Tricks
I didn't realise that, great to know. Thanks!
regexman1··on SQL Tips and Tricks
I'll add this as a caveat. I'm an analyst so my SQL isn't really exposed to anyone other than myself and so I wasn't aware of this, thanks for flagging.