首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

SQL的删除元组有关问题

2012-01-30 
SQL的删除元组问题我用SQL2000的时候,建了两个同学数据有birthday是1986-3-21和1987-3-21,用deletefrom pu

SQL的删除元组问题
我用SQL2000的时候,建了两个同学数据有birthday是1986-3-21和1987-3-21,用
delete 
from pupil
where birthday<1987-3-21

随便用<或>,都会把数据全删了

[解决办法]

SQL code
create table t(birth datetime)insert into t select '1986-3-21'insert into t select '1987-3-21'select * from tdelete from twhere birth<'1987-3-21'--(1行受影响)select * from tinsert into t select '1986-3-21'delete from twhere birth>'1987-3-21'--(0行受影响)select * from tdelete from twhere birth>1987-3-21--(2行受影响)select * from tgodrop table t 

热点排行