The faq says "Database Administrators - Stack Exchange is for database professionals who wish to improve their database skills and learn from others in the community. ". Where should one go to ask DB questions if they're not a professional, just a person trying to muck their way through some basic oracle sql? thanks.
Change to a "searched" CASE expression. You have a "simple" CASE expression above
CASE
WHEN ProductLine IN ('R', 'M', ...) THEN 'Road'
ELSE 'Not for sale'
END
From the MSDN link above:
Simple CASE expression:
CASE input_expression
WHEN when_expression THEN result_expression [ .....
Nowhere. You use the CASE expression for "inline IF"
SELECT Shift.ShiftID,
Line.Line,
( SELECT SUM(DATEDIFF(MINUTE,
CASE
WHEN ManPowerUsage.FromDT >= Shift.FromDT
THEN ManPowerUsage.FromDT
ELSE Shift.FromDT
...
thanks. finally figured out what was stumping us: the trailing END AS "thing" must be in double quotes. This one, dba.stackexchange.com/questions/665/…, gave an example that was close enough to ours to give the final clue.
I appreciate your time. I hope you always get the same when you need it :)
true, though building an app on a DBMS that, if growth exceeds the free version means I'll have to spend booku-bucks...Gah, I'm jaded. I work at a small company that can't afford it :)