When I am using an expression as a column(without alias) in my query, the driver returns the column number, instead of the name
How can I fetch the column names, instead of column numbers?
When I am using an expression as a column(without alias) in my query, the driver returns the column number, instead of the name
How can I fetch the column names, instead of column numbers?
If you want to retrieve columns by name, then give that column a name using AS
.
Change your query to:
select sum(a.salary) as total_salary, a.id from q.staff a group by a.id