By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table table1(col1 varchar(50), col2 varchar(50));
insert into table1 values('AB','AB123');
insert into table1 values('BC123','SG');
insert into table1 values('BG274','1');
insert into table1 values('DC','DG789');
insert into table1 values('DG156','HD');
5 rows affected
select col1 from table1 where col1 like '%[A-Za-z]%' and col1 like '%[0-9]%'
union
select col2 from table1 where col2 like '%[A-Za-z]%' and col2 like '%[0-9]%'
col1 |
---|
AB123 |
BC123 |
BG274 |
DG156 |
DG789 |