Closed MarioVanDenEijnde closed 8 years ago
You can use FIRST()
aggregator like:
res2 = alasql('SELECT Project, FIRST(Aannemer) AS Aannemer, ARRAY(b._) AS keuringen \
FROM ? a JOIN ? b USING Project GROUP BY Project', [res1,res]);
Thanks. That did it. There is not something that includes all available columns?
Unfortunately, currently no (because, there is not such functionality in original SQL).
@mathiasrw What do you think about FIRST(*)
extension of SQL to save all columns from the record to prevent multiple columns in GROUP BY?
SELECT FIRST(*) FROM a GROUP BY id
SELECT FIRST(a.*) FROM a JOIN b USING id GROUP BY id
FIRST(*)
would be a very neat addition to the specs :+1:
Hello ALASQL team,
It seems I have to add every SELECT column (res1) also to the GROUP BY Like below if I don't add "Aannemer" to the GROUP BY it will not be part of the result. But I have many columns in res1. Is this the only way?
Kind regards, Mario