Insert into FD_Intras(cIntrID,irate_id,DbDate,nzy,ncq,nyq,ncdell,nde,bde,irate_b_id) select '无利率',
Select sMax0Id from fd_entities where iBIType=8 ,
'2005-06-21',5.6,0,0,0,0,0,
sMax0Id from fd_entities where iBIType=97其中里边的2个sMax0Id都是从另外一个表中查出来的一个字段值。我想将这2个查出来的字段作为2个值,插入到另一个表中。怎么在一条语句中都写出来??不知道我的描述是否明白?
Select sMax0Id from fd_entities where iBIType=8 ,
'2005-06-21',5.6,0,0,0,0,0,
sMax0Id from fd_entities where iBIType=97其中里边的2个sMax0Id都是从另外一个表中查出来的一个字段值。我想将这2个查出来的字段作为2个值,插入到另一个表中。怎么在一条语句中都写出来??不知道我的描述是否明白?
select '无利率',A.sMax0Id,'2005-06-21',5.6,0,0,0,0,0,B.sMax0Id
from fd_entities A,fd_entities B
where A.iBIType=8 AND B.iBIType=97
select '无利率',A.sMax0Id,'2005-06-21',5.6,0,0,0,0,0,B.sMax0Id
from fd_entities A
left join fd_entities B on A.cIntrID=BcIntrID
where A.iBIType=8 AND B.iBIType=97
values('无利率',Select sMax0Id from fd_entities where iBIType=8 ,'2005-06-21',5.6,0,0,0,0,0,select sMax0Id from fd_entities where iBIType=97 );写在一条语句当中没有什么好处最好还是分开写
Insert into FD_Intras(cIntrID,irate_id,DbDate,nzy,ncq,nyq,ncdell,nde,bde,irate_b_id) select '无利率',
Select top 1 sMax0Id from fd_entities where iBIType=8 ,
'2005-06-21',5.6,0,0,0,0,0,
sMax0Id from fd_entities where iBIType=97
返回一个集合的话可能会出问题;
但楼主的语法错不在这里;
只要将第二个select语句用括号括起来就可以调试通过:
Insert into FD_Intras(cIntrID,irate_id,DbDate,nzy,ncq,nyq,ncdell,nde,bde,irate_b_id) select '无利率',
(Select top 1 sMax0Id from fd_entities where iBIType=8 ),
'2005-06-21',5.6,0,0,0,0,0,
sMax0Id from fd_entities where iBIType=97