Find the total sales for each quarter, but only for sales that occurred on the first day of the month.
CREATE TABLE sales (sale_date DATE, sales_amount DECIMAL); INSERT INTO sales (sale_date, sales_amount) VALUES ('2023-01-01', 100.00), ('2023-01-15', 200.00), ('2023-04-01', 150.00), ('2023-07-01', 300.00);
```sql
SELECT 
    TO_CHAR(sale_date, 'YYYY-Q') AS quarter,
    SUM(sales_amount) AS total_sales
FROM 
    sales
WHERE 
    sale_date = DATE_TRUNC('month', sale_date)
GROUP BY 
    TO_CHAR(sale_date, 'YYYY-Q');
```
```sql
SELECT 
    QUARTER(sale_date) AS quarter,
    SUM(sales_amount) AS total_sales
FROM 
    sales
WHERE 
    DAY(sale_date) = 1
GROUP BY 
    QUARTER(sale_date);
```