0

enter image description here

In This table I want sum of number_of_provisioning_jobs based on Start_Time with only in MYSQL.

In Oracle I can use "over (partition by columns_name " I can use, but MYSQL I didn't get any option.

select Start_Time,
                Manufacturer,
                Model,
                Number_of_Provisioning_Jobs,
                sum(Number_of_Provisioning_Jobs) over(partition BY Start_Time) Toatl1,
                ROW_NUMBER() OVER(PARTITION BY Start_Time ORDER BY Start_Time) as rank
           from (another tables select query) t

How to get the Sum value based on only one column?

Micho
  • 3,929
  • 13
  • 37
  • 40
  • 2
    Are you using MySQL or MariaDB? [MariaDB supports over since 10.2](https://mariadb.com/kb/en/library/aggregate-functions-as-window-functions/) and [MySQL will support over at 8.0](https://dev.mysql.com/doc/refman/8.0/en/window-functions-usage.html) –  Feb 13 '18 at 06:28
  • 1
    https://stackoverflow.com/questions/17664436/cumulative-sum-over-a-set-of-rows-in-mysql , https://stackoverflow.com/questions/3333665/rank-function-in-mysql – P.Salmon Feb 13 '18 at 08:31
  • See https://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-me-to-be-a-very-simple-sql-query if you're still struggling – Strawberry Feb 13 '18 at 08:44

0 Answers0