3 ms·
Please see my other answer as well https://news.ycombinator.com/item?id=31810593 https://news.ycombinator.com/item?id=31810593 Quick question. This. with
by zasdffaa 4y ago
Please see my other answer as well https://news.ycombinator.com/item?id=31810593 https://news.ycombinator.com/item?id=31810593
Quick question. This.
with tbl as
(
select x
from ( values (10), (20), (30) )as tt(x)
)
select \*
from tbl
where x not in (10, 30)
this gets you
x
---
20
as the result
without running this (same query as above but for addition of a null):
with tbl as
(
select x
from ( values (10), (20), (30) )as tt(x)
)
select \*
from tbl
where x not in (10, 30, null)
what's the result?
This can be an expensive mistake. It threw my old company into a flurry. Rare, but it happens - do you know why?
> while there is plenty vendor-specific knowhow, that is just stuff to learn
that stuff is precisely the difference between sleeping at night and "WTF now???, it's 3am and the clients are phoning me from singapore". And then losing your company or spending 20X unnecessarily on a scaling up box. You underestimate it.
> You are either overestimating how hard it is to learn all this stuff, or you are underestimating how close you are to being able to do it yourself.
Yeah, this discussion has been a major eye opener for me. I wish it had come much earlier. Thanks.
- icambron 4y agoI know how `NOT IN (null)` works just fine. Now what? Remember that full stack devs have also been writing SQL for their whole careers. It's weird that you have somehow confused "I have specifically avoided these parts of the stack" with "LOL you guys must not know SQL". Just a bizarre thing to say.
- zasdffaa 4y agoMy point was if you don't know something well, you fall into expensive traps. This was one that hit our company - some sql devs don't even know sql has ternary logic and why that matters. Another that hit our company, was not understanding isolation levels in SQL, meaning that two people who could write SQL very well didn't realise their approach to avoiding a race condition just didn't work. When I pointed that out, they had a hotfix on client sites by the end of that afternoon. I worked on the Cassandra database, we were having problems (albeit in development, it didn't reach production). Turns out truncating in the database did not release the space. That was causing people a lot of problems in till I ran into that by chance. These were full-stack, and smart, I respected them. You can't have what I consider thorough knowledge on all fronts, and if you don't you can pay very heavily (I can give other examples). No more than that, no LOL'ing at people. Draw your own conclusions I guess. Anyway, thank you for taking the time to reply and for several people here pointing out that I've got the wrong end of the stick. Edit: the sql example was me trying to make a point, not trying to catch you out. Please don't take it that way. It came across badly.