3 ms·
One way I've seen it used is when you need to order by all or nearly all of the columns in a select statement. Sometimes select a.1, a.2, a.3, ... a.10 GROUP B
by MaxGabriel 6y ago
One way I've seen it used is when you need to order by all or nearly all of the columns in a select statement. Sometimes
select a.1, a.2, a.3, ... a.10 GROUP BY 1,2,3,4,5,6,7,8,9,10
conveys the intent more clearly than listing out all the column names
- sk5t 6y agoIt is also very helpful to avoid re-typing expressions. select a || 'baz', avg(b) from foo group by 1 order by 2;