Sign up, and you'll be able to customize your font size and more! Sign up
May 17, 2024
3:15:42pm
Digital Gangsta Truly Addicted User
Tech data question (or maybe logic question?) combining IN and NOT IN clauses
I feel like I've been asking a lot of questions of CB lately, so thanks for those that respond ... here's another.

I'm a very technical data guy, but always aware of all that I don't know and open to learning. I'm only intermediate with my SQL because I only worked with SQL server for about 2.5 years in my career.

Currently working with a contractor and some folks internal to my org on best way to query some data. I was given a NOT IN SQL query to identify the records we want. I'm a tech/data guy, not a SME, so I just took what I was given and went with it. Contractor is questioning why we're using NOT IN and requesting we use an IN clause. Personally, I'm not convinced it makes a difference one way or another, we're just always going to have to update queries as we learn more and as more data comes in.

An internal PhD guy, SME, says we really should be using an IN and NOT IN clause combined (on the same field). So, my real question is ... does this make any logical sense at all? I've never seen that done and for the life of me can't figure out where he's coming from. My fairly limited experience with him is that he might be a moron, but I'm not positive. I asked him his reasoning in the one meeting we had and he did some hand waving and said some words, but none of his answer made any sense to me. I can't think of a scenario where using an IN and NOT IN clause on the same field would make any sense, seems more like an admission that he doesn't know the values he's looking for, no?

Appreciate any insight anybody has that might educate me if I'm somehow missing something, though. Thanks!
Digital Gangsta
New username
Czar-castic
Bio page
Digital Gangsta
Joined
May 6, 2021
Last login
May 27, 2024
Total posts
0 (0 FO)