1

我已经有一个结果集,但我对具有相同结果的替代查询感兴趣。他们之间有什么更好或更快的?

insert into [dbo].[Teams]  values(1,'First')
insert into [dbo].[Teams]  values(2,'Second')
insert into [dbo].[Teams]  values(3,'Third')
insert into [dbo].[Teams]  values(4,'Fourth')
insert into [dbo].[Teams]  values(5,'Fifth')

CREATE TABLE [dbo].[Team_team] (
[id1] [int] NOT NULL,
[id2] [int] NOT NULL
) ON [PRIMARY]
GO

select * from teams;

select t1.id,t2.id  from teams t2 cross join teams t1 
4

1 回答 1

0

这与其他语法相同:

select t1.id,t2.id  from teams t1, teams t2

不会有性能差异。

于 2013-10-24T15:22:43.153 回答