i want to make a selection that excludes the entries that start with 07, 0256 and 0356.
this is what i tired:
SELECT * FROM rapoarte WHERE nrtel NOT LIKE '07%' OR nrtel NOT LIKE '0256%' OR nrtel NOT LIKE '0356%'
but it keeps selecting all the entries.
The condition
nrtel NOT LIKE '0256%' OR nrtel NOT LIKE '0356%'is always true (unless nrtel is NULL). You need to use AND:Or you could rewrite it as follows if you find it easier to read:
The expression
(NOT a) OR (NOT B)is not the same asNOT (a OR b). See De Morgan’s Laws.