SQL more elegant combination of boolean checks possible?
- by Matze
Call me pedantic but is there a more elegant way to combine all those checks?
SELECT * FROM [TABLE1]
WHERE [path] = 'RECEIVE'
AND [src_ip] NOT LIKE '10.48.20.10'
AND [src_ip] NOT LIKE '0.%'
AND [src_ip] NOT LIKE '127.%'
ORDER BY [date],[time] DESC;
To something like this:
SELECT * FROM [TABLE1]
WHERE [path] = 'RECEIVE'
AND [src_ip] NOT LIKE IN ('10.48.20.10','0.%','127.%', .... )
ORDER BY [date],[time] DESC;