php - How to generate a USING clause in JOIN queries with Laravel's Query Builder? -
postgresql supports using clauses in join statements, , want use simplify query. example:
select * join b using (x, y, z) ... order x;
how express laravel's query builder or eloquent?
db::table('a') ->select('*') ->join('b', function($join)) ->where(...) ->orderby('x');
note question different https://stackoverflow.com/questions/31465918/how-to-generate-a-natural-join-query-with-laravels-query-builder asking natural join, not join using.
also, i'm aware can have same effect multiple $join->on(...)
statements, have duplicate columns , must quality columns in both a
, b
. is, i'd have write 'a.x'
instead of 'x'
though doesn't matter, because join query ensures both equal anyway. using clause solves problem neatly, generating single result column x
, knowing there 1 value.
so, answer - it's impossible.
i continued question on laravel 5, , it's still impossible.
my question - laravel 5. using using operator
my pull request - https://github.com/laravel/framework/pull/12773
Comments
Post a Comment