在=
之前的语法错误处获取错误
select t_name,
case
when a=b then 'Isoscels'
when a=b=c then 'Equilateral'
when a<>b<>c then 'Scalene'
when (a+b)<c then 'Not A Triangle'
end as t_name
from triangles
我怀疑这是您想要的逻辑:
SELECT
t_name,
CASE WHEN a = b THEN 'Isoscels'
WHEN a = b AND b = c AND a = c THEN 'Equilateral'
WHEN a <> b AND b <> c AND a <> c THEN 'Scalene'
ELSE 'Not A Triangle' END AS t_name
FROM triangles;
据我所知,不可能在SQL Server中链接等式表达式,因为您可能可以用其他语言(例如JavaScript或PHP)来做。