if-not-exists is a common SQL condition used to check if an entity exists.

learn more… | top users | synonyms

1
vote
1answer
4k views

MySQL: NOT EXISTS vs LEFT OUTER JOIN…IS NULL

Is NOT EXISTS or LEFT OUTER JOIN...IS NULL more efficient for finding records in one table that aren't in another? Specifically, I'm trying to figure out which of the two queries below is better: ...
0
votes
1answer
16 views

select string that doesn't contain a substring/field

TableA.content is varchar2(4000), which was populated from a CLOB value that contains markup and text for a website, paragraphs actually. TableB.keyword contains a string that I want to find in ...
0
votes
1answer
36 views

Adding a constant IF not in an other table

So I have this query. SELECT * FROM `Comment` WHERE `Target` = '".$_GET['pp']."' AND `Id` NOT IN (SELECT `Target` FROM `Delete` WHERE `Type` = 'comment') ORDER ...
0
votes
0answers
32 views

Conditional select needed

I have something like: SELECT ((SELECT SUM(VAL_TOTALA_FEROASE+VAL_TOTALA_NEFEROASE+VAL_TOTALA_ALTELE1+VAL_TOTALA_ALTELE2+ ...