Lets say I have a Table with 3 columns
|aaa | bbb | ccc|
|---------------|
|111 | 123 | uuu|
|333 | 234 | uuu|
|555 | 345 | nnn|
Now I select a sum like:
SELECT *, sum(bbb) as bbb from myTable GROUP BY ccc
I recive
|aaa | bbb | ccc | bbb|
|---------------------|
|333 | 234 | uuu | 357|
|555 | 345 | nnn | 345|
bbb is set new in output...
Is there a way to replace the column that exists so I get:
|aaa | bbb | ccc |
|----------------|
|333 | 357 | uuu |
|555 | 345 | nnn |
I know I could use an other name but using an other name is not the question :)
select aaa,sum(bbb) as bbb,ccc from myTable GROUP BY cccgroup by, with a column in theselectthat is not in thegroup by.