select *
FROM ##RawTrans
ORDER BY GroupBy ASC,
CASE WHEN @RepType = 'Emp' THEN
CASE WHEN @OrderBy = 0 THEN [Code] ELSE [Name] END, [Date], [Time]
CASE WHEN @RepType = 'ClockEmp' THEN
[Clock], CASE WHEN @OrderBy = 0 THEN [Code] ELSE [Name] END, [Date], [Time]
CASE WHEN @RepType = 'EmpClock' THEN
CASE WHEN @OrderBy = 0 THEN [Code] ELSE [Name] END, [Clock], [Date], [Time]
END
有人可以帮我知道我在这段代码中的错误在哪里吗?
我在第 7 行遇到错误
[',' 附近的语法不正确]
GroupBy 是在此代码之前声明的变量