clear markdown compare help donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 462208 distinct fiddles created so far.

CREATE TABLE test (idC INT(6), entryDate DATETIME) AS SELECT 1 idC, '2019-07-01 12:04:00' entryDate UNION ALL SELECT 1 idC, '2020-07-01 12:04:00' entryDate UNION ALL SELECT 2 idC, '2019-07-01 12:04:00' entryDate
 hidden batch(es)


select * from test
idC entryDate
1 2019-07-01 12:04:00
1 2020-07-01 12:04:00
2 2019-07-01 12:04:00
 hidden batch(es)


SELECT CONCAT(idC, '/', DATE_FORMAT(entryDate, '%Y')) as idC FROM test ORDER BY SUBSTRING_INDEX(idC, '/', -1), SUBSTRING_INDEX(idC, '/', 1) ASC
idC
1/2019
1/2020
2/2019
 hidden batch(es)