I have a column in sql table where you can store anything (character, numeric, special character, blank space or a combination of all). I want to find or have a select statement which returns all values except those containing purely numeric values or blank spaces only.
ex if I have values
it should give all rows except 3rd and 5th
where ISNUMERIC(col) != 1 and len(rtrim(col)) >= 1
full example:
create table #t1 (col varchar(50))
insert into #t1 (col) values('ABCD')
insert into #t1 (col) values('abcd')
insert into #t1 (col) values('1234')
insert into #t1 (col) values('AB12')
insert into #t1 (col) values(' ')
insert into #t1 (col) values('12AB')
insert into #t1 (col) values('ab@!')
insert into #t1 (col) values('@!12')
insert into #t1 (col) values('!@#$')
select col
from #t1
where isnumeric(col) != 1 and len(rtrim(col)) >= 1
drop table #t1