【发布时间】:2018-10-08 19:24:26
【问题描述】:
请帮忙。我有以下选择查询,并且只想选择列 A.Name 重复超过 1 次的行:
SELECT
A.Payer,
A.PaymentDate,
A.Name
FROM
(SELECT
T.InstitutionRoleXrefLongName AS 'Payer',
T.PaymentDate AS 'PaymentDate',
T.FullName AS 'Name'
FROM
Transfer T
UNION ALL
SELECT
T.InstitutionRoleXrefLongName AS 'Payer',
T.PaymentDate AS 'PaymentDate',
T.FullName AS 'Name'
FROM
TransferClosed T) A
WHERE
PaymentDate BETWEEN '20180101' AND '20180331 23:59:59'
【问题讨论】:
标签: sql-server having derived-table