SELECT b_items_p_id FROM public.box WHERE b_id =1
{1,3,5}
Now on each of these value, ie, 1, 3 and 5 I want to run another select query:
select p_desc from public.products where p_id = 1
You can join box
and products
using the any()
operator, like so:
select p_desc
from public.box b
inner join public.products p on p.p_id = any(b.b_items_p_id)
where b.b_id =1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.