The query builder may also be used to write join statements.
To perform a basic "join", you may use the join method on a query builder instance.
You can join to multiple tables in a single query with Where condition:
To perform a basic "join", you may use the join method on a query builder instance.
You can join to multiple tables in a single query with Where condition:
$pandl = DB::table('pandls')
->join('accounts', 'pandls.acc_id', '=', 'accounts.id')
->join('categories', 'pandls.cat_id', '=', 'categories.id')
->select('pandls.*', 'accounts.name', 'categories.cat_name')
->where('pl_type', 1)
->get();
No comments:
Post a Comment