L
Luqman
A table has article codes saved in a format of art1art2art3 (no commas or
any separator in between but all codes are of 03 chars).
Say the table data is as under:-
Code Name
art1art2 Item 1
art1 Item 2
art2 Item 3
art1art3 Item 4
art2art3 Item 5
Now I would like to search through query, all items having art1 or art3 in
code, how can I do so, please note, there could be more than 100 codes in
searh criteria.
The ways I know is either use union query
1ST EXAMPLE
===========
Select * from myTable
Where code like '%art1%'
Union
Select * from myTable
Where code like '%art3%'
2ND EXAMPLE
============
Select * from myTable
Where code like '%art1%'
OR
code like '%art3%'
If I save all my required searching codes in a table, how can I use those
values in query.
Something like :
select * from myTable
where code like
(select code from mySearch)
Please note, I cannot use 'code in' because the codes in mytable are saved
in a concatenation manner without any delimiters or seperators.
Any suggestions please ?
Best Regards,
Luqman
any separator in between but all codes are of 03 chars).
Say the table data is as under:-
Code Name
art1art2 Item 1
art1 Item 2
art2 Item 3
art1art3 Item 4
art2art3 Item 5
Now I would like to search through query, all items having art1 or art3 in
code, how can I do so, please note, there could be more than 100 codes in
searh criteria.
The ways I know is either use union query
1ST EXAMPLE
===========
Select * from myTable
Where code like '%art1%'
Union
Select * from myTable
Where code like '%art3%'
2ND EXAMPLE
============
Select * from myTable
Where code like '%art1%'
OR
code like '%art3%'
If I save all my required searching codes in a table, how can I use those
values in query.
Something like :
select * from myTable
where code like
(select code from mySearch)
Please note, I cannot use 'code in' because the codes in mytable are saved
in a concatenation manner without any delimiters or seperators.
Any suggestions please ?
Best Regards,
Luqman