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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.