We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have the query with subquery columns. I need to make aliases for subquery columns for having;
having
$result = $database ->select([ 'table1.id', $database->select('COUNT(1)')->from('table2')->where('inner_id', new Expression('table1.id')), // as cnt1 ]) ->from('table1') ->fetchAll();
now I need to do weird things like this
$result = $database ->select([ 'table1.id', new Fragment('('.$database->select('COUNT(1)')->from('table2')->where('inner_id', new Expression('table1.id')).') as cnt1'), ]) ->from('table1') ->having('cnt1', 1) ->fetchAll();
We need something like ColumnAliasInjection to make it prettier
ColumnAliasInjection
$result = $database ->select([ 'table1.id', new ColumnAliasInjection( $database->select('COUNT(1)')->from('table2')->where('inner_id', new Expression('table1.id')), 'cnt1' ) ]) ->from('table1') ->having('cnt1', 1) ->fetchAll();
The text was updated successfully, but these errors were encountered:
Why not
->select([ 'id' => 'table1.id', 'cnt1' => new Fragment('('.$database->select('COUNT(1)')->from('table2')->where('inner_id', new Expression('table1.id')).')'), ])
etc. ?
Sorry, something went wrong.
has common traits with #200
roxblnfk
No branches or pull requests
I have an idea!
I have the query with subquery columns. I need to make aliases for subquery columns for
having
;now I need to do weird things like this
We need something like
ColumnAliasInjection
to make it prettierThe text was updated successfully, but these errors were encountered: