SELECT *
FROM booking
CASE
WHEN Travel_Date <= getDate() THEN 'Past Travel
ELSE 'Future'
END AS 'Has travel happened'
答案 0 :(得分:1)
试试这个:
SELECT *,
CASE
WHEN Travel_Date <= CURDATE() THEN 'Past Travel'
ELSE 'Future'
END AS 'Has travel happened'
FROM booking