Tuesday, June 05, 2007

多表连接删除的sql

{[ODBC;Driver={Driver para o Microsoft Visual FoxPro};UID=;PWD=;SourceDB=\\192.168.1.10\SPCS_Administration\Fretag\FTG19;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;]}
--select a.artnr from wsart a ,art b where a.artnr=b.artnr and b.artgrp="";
--delete from wsart where exists (select a.artnr from wsart a ,art b where a.artnr=b.artnr and b.artgrp="") ;
--delete from pris where exists (select a.artnr from pris a ,art b where a.artnr=b.artnr and b.artgrp="") ;
--select a.artnr from inkpris a ,art b where a.artnr=b.artnr and b.artgrp="";
--select * from art where artgrp="";

--delete from inkpris where exists (select a.artnr from inkpris a ,art b where a.artnr=b.artnr and b.artgrp="") ;
delete from art where artgrp="";