How to get all unique years from a date column using Sql(Mysql)?

Get all unique years from a date column using Sql(Mysql)?

SELECT distinct year(OrderDate) FROM Orders;

SELECT distinct year(column_name) FROM table_name;

Leave a Reply

Your email address will not be published. Required fields are marked *