110,537
社区成员
发帖
与我相关
我的任务
分享
insert into ProjectDetail(MainID,BoardID,Besure)
select top 1 [234],[BoardID],[0] from Temp_Assign where CommType='04' order by EleUsedCount
union
select top 2 [234],[BoardID],[0] from Temp_Assign where CommType='05' order by EleUsedCount
insert into ProjectDetail(MainID,BoardID,Besure)
select 234,BoardID,0 from (select top 1 BoardID from Temp_Assign where CommType='04' order by EleUsedCount) a
union
select 234,BoardID,0 from (select top 2 BoardID from Temp_Assign where CommType='05' order by EleUsedCount)b
insert into ProjectDetail(MainID,BoardID,Besure)
select 234,BoardID,0 from
(
select top 1 BoardID,EleUsedCount from Temp_Assign where CommType='04'
union
select top 2 BoardID,EleUsedCount from Temp_Assign where CommType='05'
)
a
order by CommType,EleUsedCount
insert into ProjectDetail(MainID,BoardID,Besure)
select top 1 234,BoardID,0 from Temp_Assign where CommType='04'
union
select top 2 234,BoardID,0 from Temp_Assign where CommType='05' order by EleUsedCount
insert into ProjectDetail(MainID,BoardID,Besure)
select top 1 字段1,字段2,字段3 from Temp_Assign where CommType='04' order by EleUsedCount ;
insert into ProjectDetail(MainID,BoardID,Besure)
select top 2 字段1,字段2,字段3 from Temp_Assign where CommType='05' order by EleUsedCount ;