നിങ്ങൾ മതങ്ങളിലേക്ക്
ചുരുങ്ങി മരിക്കുമ്പോൾ,
ഞങ്ങൾ മനുഷ്യരിലേക്ക്
പടർന്ന് അമരന്മാരാകും.
അമരന്മാർ
തുടരും
സമരസൂര്യൻ
അസ്തമച്ചോപ്പിൽ
അലിയുമ്പോൾ,
അയാൾ ഉയർത്തിയ
ആശയത്തിന് കീഴെ
നാമിനിയും പോരാട്ടം
തുടരും.
NOT IN vs NOT EXISTS in PL/SQL
SELECT *
FROM TABLE1
WHERE ID NOT IN (
SELECT ID
FROM TABLE2
)
When I ran the above query I know the condition will give me the results, because the data exists in the TABLE1 which is not in TABLE2. But I didn’t go any results. I got surprised. After I a while I found out the issue.
So the reason is that ID column in the TABLE2 have null values. If any value of ID in the subquery is NULL, then the entire NOT IN clause fails to match anything. This is standard SQL behavior because NULL makes the whole comparison unknown.
Solution:
- You can use
NOT NULLcondition in the sub-query as below:
SELECT *
FROM TABLE1
WHERE ID NOT IN (
SELECT ID
FROM TABLE2
WHERE ID IS NOT NULL
)
- Use
NOT EXISTS:
SELECT *
FROM TABLE1 T1
WHERE NOT EXISTS (
SELECT 1
FROM TABLE2 T2
WHERE T1.ID = T2.ID
)
The NOT EXISTS will automatically handle null values and safer to use.
References
Good bye Georgia!
Until next time, good bye Georgia! Thank you for filling my hands with memories and my heart with love and kindness. ♥️🇬🇪

Whispering winds
When the mountain smiles and the wind whispers to you, you’ll know you’re a mountain person.

I'm not dreaming
Don’t wake me, I’m not dreaming. 🇬🇪 🌉

Mountains
Mountains are mighty protectors, guardians of centuries-old tales. To hear their stories, you must bow in reverence. Then, the snow will smile upon you, and the trees will whisper their hidden truths. 🇬🇪 ⛰

New kind of magic.
Traveling is like reading a poem, every new path holds a new kind of magic. 🇬🇪✨

ഏതോ തെരുവിലാണ് ഞാൻ
ഏതോ തെരുവിലാണ് ഞാൻ. പൊടിപിടിച്ച ഓർമകളുടെ ബലത്തിൽ ഇന്നും വഴി തെറ്റാതെ നടക്കുന്നുവെന്ന് മാത്രം. മങ്ങിയ കാഴ്ചകളുടെ അപ്പുറത്താണ് പ്രകാശമെന്ന് സ്വയം പ്രതീക്ഷയോടെ മുന്നോട്ട് നടക്കുമ്പോളും ചുറ്റുമുള്ള എല്ലാം ഞാൻ ഇഷ്ട്ടപ്പെടുന്നു.