Chinaunix首页 | 论坛 | 博客
  • 博客访问: 670544
  • 博文数量: 168
  • 博客积分: 2928
  • 博客等级: 中校
  • 技术积分: 1904
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-04 09:56
文章分类

全部博文(168)

文章存档

2010年(168)

我的朋友

分类: 数据库开发技术

2010-01-11 18:36:46

首先用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技术博客

 
阅读(1141) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~