所以我有疑问:
SELECT worker_ID as widp, DAYS, MAX(ID_WERSJI) max , funcion1 as FUN1,function2 as FUN2,function3 as FUN3,function4 as FUN4,function5 as FUN5
FROM `grafik201105`
WHERE
funcion1 IN ('one','two','three','four','five','six') OR
function2 IN ('one','two','three','four','five','six') OR
function3 IN ('one','two','three','four','five','six') OR
function4 IN ('one','two','three','four','five','six') OR
function5 IN ('one','two','three','four','five','six') AND
active=1
GROUP BY widp, FUN1,DAYS) as dni
现在我需要在一列('give_me_all')中获得 fun1、fun2、fun3、fun4 和 fun5 并且!在 fun1='one' 中,将 'one' 替换为 'first',如果是 'two' 然后是第二,三个 => 第三...
我尝试使用 if(fun1='one','first',fun1) 但我认为这里更好的解决方案是使用 CASE 但我不知道如何使用它