sql case when 问题
SELECT item, prthick, prwidth, prlongth, setpic, set1pic, set2pic, set3pic, set4pic, setcab, xjtrue, Zktrue, sj1s AS qc1s, sj2s AS qc2s, sj3s AS qc3s, sj4s AS qc4s,zkqc = (CASE WHEN Zktrue = .f. THEN 0 ELSE sjjc - sjzk END), pqqc = (CASE WHEN Zktrue = .f. THEN sjjc - sjpq ELSE sjzk - sjpq END) FROM TB_生产跟踪表_B老是报then附近有语法错误?请教各位大侠。
但在SQL中它改为这样了:SELECT item, prthick, prwidth, prlongth, setpic, set1pic, set2pic, set3pic, set4pic, setcab, xjtrue, Zktrue, sj1s AS qc1s, sj2s AS qc2s, sj3s AS qc3s, sj4s AS qc4s,(CASE WHEN Zktrue = 'false' THEN 0 ELSE sjjc - sjzk END) as zkqc, (CASE WHEN Zktrue = 'false' THEN sjjc - sjpq ELSE sjzk - sjpq END)as pqqc FROM TB_生产跟踪表_B
[ 本帖最后由 lgp740401_72 于 2014-5-4 12:48 编辑 ]