Mysql looks up the data, how to find out only the year of the data, as shown in the following figure

< H2 > question < / H2 >

mysql looks for data, but how to find out only the year of the data?
for example, there are data of 2016 create_at, 2017 and 2018 in create_at.
I just want to get 2016, br, 2017, 2018
clipboard.png

clipboard.png

. < H2 > Code < / H2 >
SELECT
    created_at
FROM
    `blogs` 
where  DATE_FORMAT(created_at,"%Y");
Oct.14,2021

SELECT
    YEAR(created_at)
FROM
    `blogs`;

year


SELECT FROM_UNIXTIME (created_at,'% Y') FROM blogs


  

select distinct (year (created_at)) from blogs;

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b0a4-2c266.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b0a4-2c266.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?