📜  Laravel 8 查询生成器,内连接子句 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:11.652000             🧑  作者: Mango

代码示例2
//Left join
$users = DB::table('users')
            ->leftJoin('posts', 'users.id', '=', 'posts.user_id')
            ->get();
//Right join
$users = DB::table('users')
            ->rightJoin('posts', 'users.id', '=', 'posts.user_id')
            ->get();