我想生成一个如下的SQL查询:
select *
from ocs
where ocs.wfx_oc_no = 'OC11' and
ocs.id in (select id
from buyers
where buyers.buyer_code = 'B01')
有人可以通过laravel子查询来帮助我吗?
答案 0 :(得分:0)
$ data = OCS :: where('wfc_oc_no','OC11')-> where('id',Buyers :: where('buyer_code','B01')-> first())-> get( );