Skip to content
Advertisement

Subselect on multiples values with like operator

How to subselect on multiple values where like operator is included?

I build Table B with the ‘%’ to get all values from Table A with the like-operator.

I can get the I-values from Table A with

SELECT * FROM TABLE A WHERE VAL LIKE (‘I33.%’)

but i build Table B to go through the whole table with one statement, like

But this doesnt work. > ERROR: more than one row returned by a subquery used as an expression

Both tables are way bigger, so can i get the all values from Table A with the VAL from Table B?

Desired output

Advertisement

Answer

Following query should work in your scenario

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement