Sql语句大全--插入

今天抽空整理下项目中的Sql语句

项目中用到的Sql语句大全

    • Insert 语句,有简有难

Insert 语句,有简有难

insert into clayor
(pco,ppolnum,ptype,psn,prela,pname,pid,paddr1,paddr2,pbakcod1,pbakcod2,paccnum,pchkflag,pagtcod,pstatus,
pchksts,pauth,pkeydate,pchguser,pchgdate,pconflag,PSTSFLAG)       
values ('2586','S901351638','I','1','O1','70943388','','S983002031','S983001838','3501050000',
'3501050000','6327003172460017616','Y','250506574','A','Y','C','20091210','ESSC041','20210918','N','N')
插入付款账号
INSERT INTO SICINF (CO, POLNUM, SIGNTYPE, NAME, CHGDATE, FILLER, CRTUSER, CRTTIME) VALUES ('1186', 'C120249000', 'O', '小大', '20220302', ' ', 'JPFVPOS ', '20220302 15:43:42');
INSERT INTO SIGCINF (CO, POLNUM, SIGNTYPE, NAME, CHGDATE, FILLER, CRTUSER, CRTTIME) VALUES ('0986', 'C392970738', 'I', '哈哈', '20220328', ' ', 'JPFVPOS ', '20220328 15:43:42');
INSERT INTO ASLT(RCO, RPOLNUM, RBHID, RSEQNUM, RJOBID, RBAKCOD, RACCNUM, 
RACCNAM, RAGTCOD, RAMT, RTRANDTE, RRESULT, RFCODE)
SELECT MCO, MPOLNUM, MBHID, MSEQNUM, MJOBID, MBAKCOD, MACCNUM, 
MACCNAM, MAGTCOD, MAMT, MSYSDTE,'F','09' FROM ATPMAIN  WHERE MBHID=3536
AND MPOLNUM ='C260093912'
INSERT INTO ARSLT(RCO, RPOLNUM, RBHID, RSEQNUM, RJOBID, RBAKCOD, RACCNUM, RACCNAM, RAGTCOD, RAMT, RTRANDTE, RRESULT, RFCODE)
SELECT MCO, MPOLNUM, MBHID, MSEQNUM, MJOBID, MBAKCOD, MACCNUM,MACCNAM, MAGTCOD, MAMT, MSYSDTE,'S','00' FROM ATPMAIN WHERE MCO='0986' AND MPOLNUM ='H210366'
insert into OLAF1.CLAUA (UACO,UAPOLNUM,UAREL,UASUBREL,UAEXTRDTE,UAITPROCD,
UAITPROCT,UAFIXDATE,UAFIXTIME,UAPMTDATE,UAPGMID,UAUSERID,UASERNUM,
UAFILLER1,UAFILLER2,UAFILLER3,UAFILLER4,UAFILLER5,UAFILLER6,UAFILLER7,UAFILLER8,UAFILLER9)
values('1086','H102278138','P','','20220609','','','','','','DLCH220519','DLCH220519','','202103                        ','N                             ','','0.00','0.00','0.00','','','')
INSERT INTO OLAUF1.CLSM
SELECT A.YLCO, A.YLPOLNUM, 'T11W30',
(CASE WHEN YLTYPE = '6' THEN 'G00002'
ELSE 'G00001' END),
A.YLDUEANNV, A.YLPALPID, SUBSTR(B.COFILLER1,4,2),
A.YLINSIDNO, A.YLMPNUM ,'','','OLAS','20220614','',A.YLPOLNUM,
'','','',0,0
FROM olasf1.CLADDS A , olasuf1.LCO B WHERE A.YLCO=
B.CO AND A.YLPOLNUM = B.POLNUM AND B.RIDNUM = '01' AND B.RELAT = 'P'
and ylnldsflg = 'Y'
AND YLPOLNUM in
(
'H102598245'
);
INSERT INTO olaf1.LAIP VALUES ('94814895', '2586', 'L353416524', '000000197906150448', '94814895', '19790601', 'F', 'C', 'P', '20210424');
INSERT INTO olasf1.LAAI VALUES ('94814907', 'L353416524', '000000201805214054', '94814907', '20180502', 'M', 'C', '20200102', '43', '2586', '0', 'AA1', 'I', '    ', '    ', '20210424', '0','0','0','0','0','0','0','0','0','0', 'N', ' ', '20251128');

你可能感兴趣的:(软件测试,sql,数据库,mysql,sqlserver)