Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Exclude a sequence of characters when using LIKE

$
0
0

Hi,

Mainly I am just wondering if I can exclude a sequence when using LIKE .

I want this to return IDs that match the ending but not if they begin with the 'AB' sequence.

String List

AA000BB

AB000BB

AC000BB

AA000CC

DD000BB

SELECT * FROM List where ID like '[^AB]%BB'

Looking to return the below list rather than just DD000BB

AA000BB

AC000BB

Thanks!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>