Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Last Day of Each Month With Sales

Return each month (YYYY-MM) with its last sale date, ordered by month.

Table schema

Sales(id INT PRIMARY KEY, sale_date DATE, amount INT)

Sample data

id | sale_date | amount
1 | 2026-01-05 | 100
2 | 2026-01-20 | 50
3 | 2026-02-14 | 70
4 | 2026-04-01 | 40
5 | 2026-05-10 | 90
6 | 2026-07-04 | 60
7 | 2026-07-05 | 30

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.