SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
SELECT CUSTOMER_ID, MIN(CAST(FIRST_PAYMENT_DATE AS DATE)) FIRST_PAYMENT, MAX(CAST(FIRST_PAYMENT_DATE AS DATE)) LAST_PAYMENT, SUM(CAST(TOTAL_PAID AS FLOAT)) FROM SAKILA.DBO.PAYMENT GROUP BY CUSTOMER_ID ORDER BY FIRST_PAYMENT_DATE DESC

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear