Alright, so I’m trying to use MySQL window functions. This is a snippet of what I’ve written:
$query = (new Query())
->select('SUM(vote) OVER (PARTITION BY id, date) as test')
Looking at the query builder, I get this output:
[select] => [
0 => 'sum(vote) OVER (PARTITION BY (id'
'test' => 'date))'
]
The database will throw a syntax error when trying to process this query.
If I just use one column, like this:
$query = (new Query())
->select('SUM(vote) OVER (PARTITION BY id) as test')
The output from the query builder looks like this:
[select] => [
'test' => 'sum(vote) OVER (PARTITION BY id)'
]
And the database handles it just fine.
How do I input the two columns such that they are parsed properly? Or have a found a bug in the QueryBuilder?