Hi Any Help Correcting My Query

Hi, any help correcting my query??

/*query to capture the customer name, month and year of payment, and total payment amount for each month by these top 10 paying customers*/

WITH TOP10 (

SELECT c.customer_id, p.payment_date, Sum(p.amount) total_pmt_amount,

CONCAT(first_name,”,last_name) as full_name,

AND DATE_TRUNC(‘month’ between ‘2007-01-01’ AND ‘2007-31-12’)

FROM payment p

JOIN customer c

ON p.customer_id= c.customer_id

GROUP BY 1, 2

ORDER BY TOP10

LIMIT by 10 desc;

i think im missing a second subquery for the date_trunc, right? or can i just modify this one more so it works?

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW