Improve Like SQL statement - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Improve Like SQL statement

abenitez77abenitez77 Posts: 1Member
Is this the most effecient way to write this code or can it be improved ?

DROP TABLE DBO.AS_TMP_FLAT_PRIORITY2
SELECT DISTINCT EMAILGUID, [MESSAGE]
INTO DBO.AS_TMP_FLAT_PRIORITY2
FROM DBO.AS_EMAILS
WHERE [MESSAGE] LIKE '%$[1-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9] thou%'
OR [MESSAGE] LIKE '%$[1-9][0-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9][0-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9][0-9] thou%'
OR [MESSAGE] LIKE '%$[1-9][0-9][0-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9][0-9][0-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9][0-9][0-9] thou%'
OR [MESSAGE] LIKE '%$[1-9].[0-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9] thou%'
OR [MESSAGE] LIKE '%$[1-9].[0-9][0-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9][0-9]thou%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9][0-9] thou%'
OR [MESSAGE] LIKE '%hundred thou[ ,.!?)]%'
OR [MESSAGE] LIKE '%[eorxnty][ -]thou[ ,.!?)]%'
OR [MESSAGE] LIKE '%thousand dollars%'
OR [MESSAGE] LIKE '%hundred thousand dollars%'
OR [MESSAGE] LIKE '%[eorxnty][ -]grand%'
OR [MESSAGE] LIKE '%hundred[ -]grand%'
OR [MESSAGE] LIKE '%$[1-9][0-9][0-9]g%'
OR [MESSAGE] LIKE '%$ [1-9][0-9][0-9]g%'
OR [MESSAGE] LIKE '%$[1-9][0-9]g%'
OR [MESSAGE] LIKE '%$ [1-9][0-9]g%'
OR [MESSAGE] LIKE '%$[1-9]g%'
OR [MESSAGE] LIKE '%$ [1-9]g%'
OR [MESSAGE] LIKE '%$[1-9][0-9][0-9].[0-9]g%'
OR [MESSAGE] LIKE '%$ [1-9][0-9][0-9].[0-9]g%'
OR [MESSAGE] LIKE '%$[1-9][0-9].[0-9]g%'
OR [MESSAGE] LIKE '%$ [1-9][0-9].[0-9]g%'
OR [MESSAGE] LIKE '%$[1-9].[0-9]g%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9]g%'
OR [MESSAGE] LIKE '%$[1-9].[0-9][0-9]g%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9][0-9]g%'
OR [MESSAGE] LIKE '%$[1-9][0-9][0-9] g%'
OR [MESSAGE] LIKE '%$ [1-9][0-9][0-9] g%'
OR [MESSAGE] LIKE '%$[1-9][0-9] g%'
OR [MESSAGE] LIKE '%$ [1-9][0-9] g%'
OR [MESSAGE] LIKE '%$[1-9] g%'
OR [MESSAGE] LIKE '%$ [1-9] g%'
OR [MESSAGE] LIKE '%$[1-9][0-9][0-9].[0-9] g%'
OR [MESSAGE] LIKE '%$ [1-9][0-9][0-9].[0-9] g%'
OR [MESSAGE] LIKE '%$[1-9][0-9].[0-9] g%'
OR [MESSAGE] LIKE '%$ [1-9][0-9].[0-9] g%'
OR [MESSAGE] LIKE '%$[1-9].[0-9] g%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9] g%'
OR [MESSAGE] LIKE '%$[1-9].[0-9][0-9] g%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9][0-9] g%'
OR [MESSAGE] LIKE '%$[1-9]m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$[1-9] m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$ [1-9]m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$ [1-9] m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$[1-9].[0-9]m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$[1-9].[0-9] m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9]m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9] m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$[1-9].[0-9][0-9]m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$[1-9].[0-9][0-9] m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9][0-9]m[ ,.!?)]%'
OR [MESSAGE] LIKE '%$ [1-9].[0-9][0-9] m[ ,.!?)]%'
OR [MESSAGE] LIKE '%USD [1-9][0-9][0-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD [1-9][0-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD [1-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD [1-9][0-9][0-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD [1-9][0-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD [1-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD[1-9][0-9][0-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD[1-9][0-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD[1-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD[1-9][0-9][0-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD[1-9][0-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%USD[1-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9],[0-9][0-9][0-9] US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9],[0-9][0-9][0-9] US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9],[0-9][0-9][0-9] US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9][0-9][0-9] US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9][0-9] US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9] US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9],[0-9][0-9][0-9]US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9],[0-9][0-9][0-9]US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9],[0-9][0-9][0-9]US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9][0-9][0-9]US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9][0-9]US%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9]US%'
OR [MESSAGE] LIKE '%US [1-9][0-9][0-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US [1-9][0-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US [1-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US [1-9][0-9][0-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US [1-9][0-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US [1-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US[1-9][0-9][0-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US[1-9][0-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US[1-9],[0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US[1-9][0-9][0-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US[1-9][0-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%US[1-9][0-9][0-9][0-9]_[^0-9]%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9],[0-9][0-9][0-9] DOL%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9],[0-9][0-9][0-9] DOL%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9],[0-9][0-9][0-9] DOL%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9][0-9][0-9] DOL%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9][0-9] DOL%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9] DOL%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9],[0-9][0-9][0-9] Bucks%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9],[0-9][0-9][0-9] Bucks%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9],[0-9][0-9][0-9] Bucks%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9][0-9][0-9] Bucks%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9][0-9] Bucks%'
OR [MESSAGE] LIKE '%[^$][^$0-9][1-9][0-9][0-9][0-9] Bucks%'

Sign In or Register to comment.