The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
SQL HALP Exists/Not Exists
Deebaseron my way to work in a suit and a tieAhhhh...come on fucking guyRegistered Userregular
Please help H/A. My code isn't working and I'm having a bit of a brainfart. Here's what I am trying to do:
I want to identify all the SOMETHING_NUMs that we have from an external feed that don't have corresponding object_ids on our internal table. object_ids are a 9 character string in the middle of SOMETHING_NUM.
What am I fucking up?
SELECT DISTINCT
SOMETHING_NUM
FROM
database..external_feed
WHERE
NOT EXISTS
(SELECT *
FROM db2..internal_tbl1 di,
database..external_feed
where
SUBSTRING(SOMETHING_NUM,3,9) = di.object_id)
SELECT DISTINCT SOMETHING_NUM
FROM database..external_feed
WHERE NOT EXISTS
( SELECT * FROM db2..internal_tbl1, di, database..external_feed di.object_id = (SUBSTRING(SOMETHING_NUM,3,9)))
If that doesn't work, what error do you get?
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
0
Deebaseron my way to work in a suit and a tieAhhhh...come on fucking guyRegistered Userregular
There's no error message. There's just no population. I know that there is a population because I did a run without the NOT EXISTS for a small sample date range.
The problem is, I can't run the full history like that because it's pretty resource hoggy.
Posts
If that doesn't work, what error do you get?
The problem is, I can't run the full history like that because it's pretty resource hoggy.
@Bowen
Please lock.