sql - Execute multiple statement in single SQLITE -
i have 4 csv file imported sqlite (mastersuppress, ddsummary, rm5, excludelist). file consist of 1 column (accountnumber).
i manage find duplicate account number between 3 file , save result in new csv file named output using code :
select mastersuppress.account mastersuppress inner join ddsummary on mastersuppress.account=ddsummary.account union select rm5.account rm5 inner join ddsummary on rm5.account=ddsummary.account then manage delete the accountnumber output file duplicate account number in excludelist file using second code :
delete output accountnumber in ( select min(accountnumber) excludelist group accountnumber ); select * output; how compile 2 code 1 code without need create output file in between process. code this
delete ***firstcoderesult*** accountnumber in ( select min(accountnumber) excludelist group accountnumber ); //display result
i phrase using except:
select m.account mastersuppress m inner join ddsummary ds on m.account = ds.account union select rm5.account rm5 inner join ddsummary ds on rm5.account = ds.account except select el.accountnumber excludelist el; except , union remove duplicates.
Comments
Post a Comment