Q&A for professional and enthusiast programmers
declare @t as table([val] varchar(10)); insert into @t select 'ABCDEEFG' union all select 'PQRSTUVW' union all select 'JKLMNOPQ' union all select 'ABCDXYZ1' union all select 'PQRSTUVW' union all select '12345678'; select * from @t where [val] not like 'PQRS%' and [val] <> 'ABCDEEFG'