34,593
社区成员
发帖
与我相关
我的任务
分享
if object_id('tt') is not null
drop table tt
if object_id('tb') is not null
drop table tb
go
Create table tt(id int,Num decimal(15,5))
Create table tb(id int,Num decimal(15,5),pID int)
go
insert into tt
select 1,0 union all
select 2,0 union all
select 3,0 union all
select 4,4
insert into tb
select 1,0,1 union all
select 2,0,1 union all
select 3,0,1 union all
select 4,4,1
go
select a.* from tb a ,(select top 1 id from tt) b
where a.pID= b.id
select * from tb a ,(select top 1 id from tt) b
where a.pID= b.id
--感觉没有区别啊
select a.* from optionInfo a
left join (********) b
on a.OptionID=b.OptionID
select a.* from optionInfo a
inner join (********) b
on a.OptionID=b.OptionID