Home PostgreSQL subquery using like
Reply: 0

PostgreSQL subquery using like

user708
1#
user708 Published in June 23, 2018, 2:27 am

lets say i have first table like this

Branch table

|name     |description|
|123456ABC|FOO        |
|553646DEF|FO2        |

and second table like this

Balance table

|name|description|
|ABC |oof        |
|DEF |2of        |

i want to query to Balance table, where each row containing name from Branch table.. for example "123456ABC" in Branch table, i want to get "ABC" row from Balance table

how could i achieve that? i've tried this query so far with no luck

select * from Balance
where name like (
        SELECT `name` FROM Branch
);

any suggestion?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306586 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO