Laravel中如何使用join?

Laravel中
$data2 = DB::table('stu_stores')
->where('stu_stores.store_id','=','stu_searches.id')
->join('stu_searches', 'stu_stores.stu_id', '=', 'stu_searches.id')
->where('Stu_stores.stu_id','=','1')
->get();
其中join中第二个参数与第三个参数的作用是什么
加粗文字
那Laravel如何实现select * from table where id=(select fam_id from table2 where id=1);
我这个写法是不正确的 我想这样找 可以吗 就是我想首先从table2表中查询出所有id=1的fam_id,然后再table表中查询出所有id=fam_id的数据 这个的正确写法应该怎么写
已邀请:

要回复问题请先登录注册