我希望通过使用临时表
找到多个相同的城市和相同的工资记录答案 0 :(得分:0)
declare @t table
(
City nvarchar(20),
Salary decimal(9, 2)
)
insert into @t
(City, Salary)
values (N'New York', 65000),
(N'London', 68000),
(N'Sydney', 59000),
(N'Sydney', 59000),
(N'Tokyo', 66000)
select *
from @t as t
group by t.City,
t.Salary
having count(1) > 1