This is how it works:
SELECT
fecha_inicio,
CASE
WHEN fecha_inicio < '2017-06-04' THEN 'MENOR'
WHEN fecha_inicio = '2017-06-04' THEN 'IGUAL'
ELSE 'MAYOR'
END as 'es'
FROM prueba_fechas;
Although I was wondering: what happens if they are the same?
That's why you see that I've added this: WHEN fecha_inicio = '2017-06-04' THEN 'IGUAL'
if you're interested in presenting the equality separately, if you're not interested you can delete this line
Note : Be careful not to have your dates formatted in the table, which would be a serious mistake and would cause problems at the time to compare
or calculate data.
Complete example
VIEW DEMO
CREATE TABLE IF NOT EXISTS prueba_fechas
('fecha_inicio' date)
;
/*
INSERT INTO prueba_fechas
('fecha_inicio')
VALUES
('2017-06-01'),
('2017-06-02'),
('2017-06-03'),
('2017-06-04'),
('2017-06-05'),
('2017-06-06')
;
*/
SELECT
fecha_inicio,
CASE
WHEN fecha_inicio < '2017-06-04' THEN 'MENOR'
WHEN fecha_inicio = '2017-06-04' THEN 'IGUAL'
ELSE 'MAYOR'
END as 'es'
FROM prueba_fechas;
result
fecha_inicio es
1 01.06.2017 00:00:00 MENOR
2 02.06.2017 00:00:00 MENOR
3 03.06.2017 00:00:00 MENOR
4 04.06.2017 00:00:00 IGUAL
5 05.06.2017 00:00:00 MAYOR
6 06.06.2017 00:00:00 MAYOR