我想创建一个视图,如下所示。
Create view SomeView
AS
SELECT DISTINCT ISNULL(ID,'ID') as Id,
ISNULL(ID,'unknown') + ':' + 'ID' AS label,
ISNULL(ID,'unknown') AS [value]
FROM [test].[emp].[OrgView]
UNION
SELECT DISTINCT ISNULL(EMP_ID,'ID') as Id,
ISNULL(EMP_ID,'unknown') + ':' + 'EMP_ID' AS label,
ISNULL(EMP_ID,'unknown') AS [value]
FROM [test].[emp].[OrgView]
UNION
SELECT DISTINCT ISNULL(LICENSE_NO,'LICENSE_NO') as Id,
ISNULL(LICENSE_NO,'unknown') + ':' + 'LICENSE_NO' AS label,
ISNULL(LICENSE_NO,'unknown') AS [value]
FROM [test].[emp].[OrgView]
.
.
.
.
.
10 such selects
所以在这种情况下,是为每个select块调用一个,还是只调用一个?我不希望这使10个不同的电话,为每个选择。如果你知道的话,请告诉我一些在线资源。
1条答案
按热度按时间mm9b1k5b1#
取消打印使用
APPLY
: