1543. Fix Product Name Format
https://leetcode.com/problems/fix-product-name-format
Description
Table: Sales
Since table Sales was filled manually in the year 2000
, product_name
may contain leading and/or trailing white spaces, also they are case-insensitive.
Write an SQL query to report
product_name
in lowercase without leading or trailing white spaces.sale_date
in the format('YYYY-MM')
.total
the number of times the product was sold in this month.
Return the result table ordered by product_name
in ascending order. In case of a tie, order it by sale_date
in ascending order.
The query result format is in the following example.
ac
Last updated