aggregated functions sql



  • a table is allowed:

    введите сюда описание изображения

    how to do select all columns + table in each cell with total salesYTD for all BUsinessEntityIDi.e. in each cell of this column the same meaning sum(salesYTD)



  • Use a separate subpoena that will return the sum.

    select *,
           (select sum(salesYTD) FROM test)
      from test
    

    Or offer. over (i.e. CBD restrictions, postgerss should work):

    select *,sum(salesYTD) over ()
      from test
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2