Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DB::table('users')
- ->where('users.id', '=', 2)
- ->join('addresses', 'users.id', '=', 'addresses.user_id')
- ->join(DB::raw("(select min(addresses.id) as id from addresses where user_id=2) AS first_address"), 'first_address.id', 'addresses.id')
- ->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement