我有一个可怕的问题查询要写
SELECT TOP 25
uinv = (CASE
WHEN exported = 1 THEN 'Sent To Accounts'
WHEN queued = 1 THEN 'Finalised'
WHEN reviewed = 1 THEN 'Pro Forma'
WHEN started = 1 THEN 'New'
END)
,
(
CAST(acc_id AS VARCHAR) + ' / ' +
CAST(transactiontype AS VARCHAR) + ' / ' +
CAST(reference AS VARCHAR) + ' / '
)
AS label
FROM tablename;
这很好用,但我需要在 AS 标签中获取 uinv 字段。我已经尝试了各种排列,但我就是无法正确...
请问有什么帮助吗?
谢谢,克里斯