SQL case expression is not giving desired result
I believe that you just want the following query (without subquery)
SELECT OCTeamName,OCTeamID,OCTeamLastTime,
CASE WHEN OCTeamLastTime >= CURRENT_TIMESTAMP
THEN 'Now'
ELSE OCTeamLastTime
END AS CanDoOC
FROM OCTable
You can use CASE
expression for this:
SELECT CASE
WHEN OCTeamLastTime < CURRENT_TIMESTAMP THEN 'Now'
ELSE OCTeamLastTime
END AS CanDoOC
FROM ...