If I have one select * from personas
that returns the following:
Nombre | Valor
-----------------
Carlos | 10
-----------------
Miguel | 20
Can I in my query add a specific value - that can be obtained through sub-queries - for each tuple?
Nombre | Valor
-----------------
Carlos | 10 (+5 #Este numero se trae de una sub-consulta)
-----------------
Miguel | 20 (+10, #Este numero se trae de una sub-consulta)
What I want is to get the following:
Nombre | Valor
-----------------
Carlos | 15
-----------------
Miguel | 30
If I could do it directly:
It can be used
+ (valor)
after the column name to add the respective value.If you are working with grouped columns you can use the
+ (valor)
within aggregate functions considering the above.This will sum
+50
for each tuple/row that has been grouped.