Z4u3z1 回复 靈靈(提问者)已进为例
SELECT MIN(DATES) \'DATES\',\'第一次\' AS I FROM TEST GROUP BY DATE_FORMAT(DATES,\'%m-%d-%Y\')
UNION ALL
SELECT MIN(DATES),\'第二次\' FROM TEST WHERE DATES NOT IN (SELECT MIN(DATES) FROM TEST GROUP BY DATE_FORMAT(DATES,\'%m-%d-%Y\')) GROUP BY DATE_FORMAT(DATES,\'%m-%d-%Y\')