Working on an exercise question 'How many distinct dates are there in the saledate column of the transaction table for each month/year combination in the database?' I found a query that works and it is obviously combining the YEAR and MONTH
SELECT DISTINCT (extract(year from saledate) || extract(month from saledate)) as SaleDate
ORDER BY SaleDate;
The || is the string concatenation command. In this query you are giving us, the numbers are converted into string and after that, concatenated.
The solution is valid, I'm afraid.
Another solution would be:
select extract( year from saledate) as year_num, extract( month from saledate) as month_num from trnsact group by extract( year from saledate ), extract( month from saledate);