SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
SELECT quarter(payment_date) quarter, monthname(payment_date) month_nm, sum(amount) monthly_sales, rank() over (partition by quarter(payment_date) ORDER BY sum(amount) decs qrt_sales_rank) FROM payment WHERE year(payment_date) = 2005 GROUP BY quarter(payment_date), monthname(payment_date) ORDER BY 1

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear