SQL???????????
???????????? ???????[ 2014/7/3 15:46:53 ] ????????SQL ?????
????4.?ж??????????????
????select count(*) from product
????select top(1) id from product
????????????????
????5.???????????
???????????ū???????????????????????????????????????????????????????????
?????????????????С???
????????????????С????????????????????????
???????????????????С????????
?????????????????????????????????????????????
????select * from
????( (select * from orde where OrderId>10000) o left join orderproduct op on o.orderNum=op.orderNum )
????select * from
????( orde o left join orderproduct op on o.orderNum=op.orderNum )
????where o.OrderId>10000
??????????????????????????????????Ч???
????insert???????
????--?????????
create table #tb1
(
id int??
name nvarchar(30)??
createTime datetime
)
declare @i int
declare @sql varchar(1000)
set @i=0
while (@i<100000) --???????10w??????
begin
set @i=@i+1
set @sql=' insert into #tb1 values('+convert(varchar(10)??@i)+'??''erzi'+convert(nvarchar(30)??@i)+'''??'''+convert(nvarchar(30)??getdate())+''')'
exec(@sql)
end
|
????--?????????
create table #tb2
(
id int??
name nvarchar(30)??
createTime datetime
)
declare @i int
declare @sql varchar(8000)
declare @j int
set @i=0
while (@i<10000) --???????10w??????
begin
set @j=0
set @sql=' insert into #tb2 select '+convert(varchar(10)??@i*100+@j)+'??''erzi'+convert(nvarchar(30)??@i*100+@j)+'''??'''+convert(varchar(50)??getdate())+''''
set @i=@i+1
while(@j<10)
begin
set @sql=@sql+' union all select '+convert(varchar(10)??@i*100+@j)+'??''erzi'+convert(nvarchar(30)??@i*100+@j)+'''??'''+convert(varchar(50)??getdate())+''''
set @j=@j+1
end
exec(@sql)
end
drop table #tb2
select count(1) from #tb2
|
?????????????insert into select????????????????Ч????????????????????????????
????????????????
????????????????????????????????cpu????????????????????????????
???????????????????????????????????????????????Ч?????????????????????????
???????????????????
???????е??????????????????
????delete product where id<1000
????delete product where id>=1000 and id<2000
????delete product where id>=2000 and id<3000
????.....
????????????????????????????????????????????????????????????????????????????????????????????????????????Ч????
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11