Hello all ... be gentle, I'm new at this:
I've got a simple case query. One works (the top one), but when I try to add additional columns to the query it fails. I reckon it's a pretty simple mistake I'm making, but I don't know what. Any help is appreciated.
-----------------------------------------------------
This works ...
SELECT CASE WHEN CHARACTER_LENGTH(system) > 65 then
CONCAT(LEFT(system, 60), " ..."
ELSE
system END
------------------------------------------------------
This doesn't ...
SELECT CASE WHEN CHARACTER_LENGTH(system) > 65 then
CONCAT(LEFT(system, 60), " ...", wsh_year, id
ELSE
system, wsh_year, id END
FROM wsh
Maybe an IF statement would work better here?
I've got a simple case query. One works (the top one), but when I try to add additional columns to the query it fails. I reckon it's a pretty simple mistake I'm making, but I don't know what. Any help is appreciated.
-----------------------------------------------------
This works ...
SELECT CASE WHEN CHARACTER_LENGTH(system) > 65 then
CONCAT(LEFT(system, 60), " ..."
ELSE
system END
------------------------------------------------------
This doesn't ...
SELECT CASE WHEN CHARACTER_LENGTH(system) > 65 then
CONCAT(LEFT(system, 60), " ...", wsh_year, id
ELSE
system, wsh_year, id END
FROM wsh
Maybe an IF statement would work better here?