Forum Moderators: open
select <col1> from <table1> where <col2> like '123%'
select <col1> from <table1> where <col2> like '456%'select <col1> from <table1> where <col2> in ('123456', 45678')
I tried a couple different variations and nothing worked like
select <col1> from <table1> where <col2> in ('123%', '456%')
CREATE TABLE <temptable>(
MyPattern DATATYPE
)INSERT INTO <temptable>( MyPattern ) VALUES( '123%' )
INSERT INTO <temptable>( MyPattern ) VALUES( '456%' )SELECT A.*
FROM <table1> AS A
LEFT JOIN <temptable> AS B ON A.<col1> LIKE B.MyPattern
WHERE B.MyPattern IS NOT NULL;
It's overkill but it does the job...
- Tony