+ -
当前位置:首页 → 问答吧 → 多年来首次求解。。多谢

多年来首次求解。。多谢

时间:2011-12-07

来源:互联网

sql 数据库的某表中 列 birthday 为出生年月日 数据如 1950-02-30 等 

 有个别数据输入错误如1088-09-55或1950-24-21等 
数据量大,求查出类似上面错误的非正常data的数据
求查询出错误的date数据的sql语句。。。。


作者: zsxking   发布时间: 2011-12-07

SQL code
select *
from tb
where isdate(birthday)=0

作者: noteasytoregister   发布时间: 2011-12-07

where isdata(column1) > 0

作者: rucypli   发布时间: 2011-12-07

引用 1 楼 noteasytoregister 的回复:
SQL code
select *
from tb
where isdate(birthday)=0

查询出来错误数据
0889-09-18
1950-22-04
1951-01-41
1331-04-20
1323-23-22

作者: zsxking   发布时间: 2011-12-07

引用 2 楼 rucypli 的回复:
where isdata(column1) > 0
isdata isdate 要细心。。。

查询数据排除错误birthday的行  


综上还是 isdate函数的使用

谢楼上两位

作者: zsxking   发布时间: 2011-12-07

SQL code
isdate

作者: fredrickhu   发布时间: 2011-12-07