Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

assign selected columns to a variable

$
0
0
Select
  sum(column_a) as a,
  sum(column_b) as b
  round(a / b)
From
  table
Group by column

In the example above I am summing two column, and I would like to use those 2 results in calculating another result, how can I do this? round(a / b) is not going to work, is just as an example of what I want to do.


Viewing all articles
Browse latest Browse all 1138

Trending Articles