SELECT Category =
CASE type
WHEN 'popular_comp' THEN 'Popular Computing'
WHEN 'mod_cook' THEN 'Modern Cooking'
WHEN 'business' THEN 'Business'
WHEN 'psychology' THEN 'Psychology'
WHEN 'trad_cook' THEN 'Traditional Cooking'
ELSE 'Not yet categorized'
END,
CAST(title AS varchar(25)) AS 'Shortened Title',
price AS Price
FROM titles
WHERE price IS NOT NULL
ORDER BY type, price
COMPUTE AVG(price) BY type
GO
这样就可以了select B.bCol_1,B.bCol_2,C.cCol_1
from TBL_B B left join TBL_C C
on B.bCol_Key = C.cCol_Key
where (B.bCol_Time <'xxxx' and B.bCol_Flag<>0) or ( C.cCol_Time <'xxxx' and B.bCol_Flag=0)
.....老大看清楚你用的有问题,=是赋值不是判断==才是判断,'1' = '1'把一个字符串赋值给另一个字符串没有意义,而且似乎也不符合语法啊,这种错误似乎很低级,我这里没有现成的调试工具,你改了这个错误看看,如果还有把错误贴一下CASE WHEN 语句 报错 可能就是因为你给了一个错误的判断条件,他的结果也不是一个布尔值啊
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)