Discussion Forum | Board Infinity

Structured query language select and group by

let suppose i have a column name as ‘first_name’ and i use alias operator and i changed into ‘name’.
so when i want to use this column in group by what i should write-actual column name or alias name.and which will
execute first in sql-select or group by statement or both simultaneously?

1 Like

Its by alias name you should use in group by
and it will execute first in Select then in group by.

ya thanks for your reply.but can you please give me an example for your statement what you told?

you can follow this link where it is clearly mentioned that “group by” will execute first and then “select”.here is the link-https://www.sisense.com/blog/sql-query-order-of-operations/.
so can you please clarify my doubts again?