3 ms·
select this, count(*) from that group by 1
by thomasdziedzic 4y ago
select this, count(*) from that group by 1
- dominotw 4y agoI actually find this less readable. i have to go back and scan the select to see what column this index corresponds to. Totally breaks the flow of reading.
- eatonphil 4y agoTested this out on Postgres and it works: SELECT name, count(1) FROM (VALUES ('Kev',12), ('Meg', 14), ('Kev', 14)) people(name, age) GROUP BY 1 Produces: [[Kev, 2], [Meg, 1]]. But I don't get it. Could someone explain how this works?
- zasdffaa 4y agoPlease never allow this into production. I believe it is deprecated, it certainly is fragile in general.