0
SELECT *
FROM booking  
CASE
WHEN Travel_Date <= getDate() THEN 'Past Travel
ELSE 'Future'
END AS 'Has travel happened'
4

1 回答 1

1

尝试这个:

SELECT *, 
  CASE 
    WHEN Travel_Date <= CURDATE() THEN 'Past Travel' 
    ELSE 'Future' 
  END AS 'Has travel happened' 
FROM booking
于 2013-07-25T16:12:58.360 回答