首先用oracle自带的sqldeveloper来连接access然后就可以在里面运行语句了。下面是语句:
Select * From 全区 Y
Where Y.字段3 not In ('08916815293',
'08928821117',
'08954567003',
'102',
'108',
'119',
'131',
'134',
'136',
'147',
'152',
'169',
'172',
'173',
'184',
'189',
'193',
'220',
'239',
'240',
'243',
'246',
'247',
'256',
'257',
'26',
'272',
'29',
'306',
'311',
'314',
'316',
'322',
'323',
'324',
'329',
'355',
'361',
'365',
'380',
'40',
'406',
'48',
'497',
'498',
'499',
'50',
'504',
'513',
'526',
'530',
'56',
'6329927',
'6807967',
'6860536',
'72',
'77',
'88',
'94',
'adsl6347238',
'adsl6819813')
delete from 全区 where 字段3 In ('08916815293',
'08928821117',
'08954567003',
'102',
'108',
'119',
'131',
'134',
'136',
'147',
'152',
'169',
'172',
'173',
'184',
'189',
'193',
'220',
'239',
'240',
'243',
'246',
'247',
'256',
'257',
'26',
'272',
'29',
'306',
'311',
'314',
'316',
'322',
'323',
'324',
'329',
'355',
'361',
'365',
'380',
'40',
'406',
'48',
'497',
'498',
'499',
'50',
'504',
'513',
'526',
'530',
'56',
'6329927',
'6807967',
'6860536',
'72',
'77',
'88',
'94',
'adsl6347238',
'adsl6819813')
要注意点的是:
mssql中:
delete from test where id=1 与 delete test where id=1是一样的
mysql中:
只能用delete from test where id =1
否则:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where id=1 at line 1
同样还要注意一点:
在开发中比如:vb+access中嵌入SQL语句进行删除时,也要写成:delete from test where id=1。不然,也是无法删除的。
本文出自 51CTO.COM技术博客