使用select语句查询 查询条件表达式要求出生日期在1990年之后 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --birthday dateselect * from tb where birthday >='1900-01-01 00:00:00' select * from tbl where 生日》='1900-01-01' select * from tb where birthday >='1900-01-01 00:00:00'orselect * from tb where birthday >='1900-01-01'都可以 select * from tb where 出生日期>='1990-01-01'上面的看清楚楼主的要求啊~是1990 不是1900 select * from tb where year(birthday) > 1989 select * from tb where birthday >='1900-01-01 00:00:00' select * from tb where birthday >='1990-01-01 00:00:00' select * from tb where cast(substring(birthday,1,4) as int)>1990substring(birthday,1,4)是取birthday的年,cast("" as int)是把年的类型转换成int,再和1990进行比较 select * from tb where birthday >='1990-01-01 00:00:00' select * from TB where birthday like '1990%%' select * from tb where birthday >='1990-01-01' select * from table where 生日字段 >='1990-01-01' select * from table where DATEPART(YEAR,生日字段) > 1989 select * from tb where birthday >='1900-01-01' select * from TB where Year(生日字段) > 1989 declare @dd datetime set @dd= '1990-10-10' select year(@dd)select * from tt where year(dd)>=1990 楼主,你的问题总给我感觉就是看上去很简单,但是又不知道是不是真的那么简单的感觉。如果你存放日期的列是datatime的话,直接和1990-01-01那个数据相对比就可以啦。 select * from 表名 where 出生日期 >= convert(varchar(4),出生日期,120)+'-01-01' select * from tb where birthday >='1900-01-01 00:00:00' 各位楼上,请注意,在数据库中查询与日期相关时建议使用函数!!!SELECT * FROM tb WHERE DATEDIFF(yy,'1990-1-1',birthday)>=0具体情况,可根据实际做出变化。 sql server 2000 vista下安装问题 请教大家一个问题了 求大家帮我写一句sql 问一个触发器触发顺序的控制问题 怎么上午好好好的。下午就不好用了。提示的错误是什么错误。高手帮忙 2个经常重复的列,如何作索引 求助如何更新这张表!! 求一SQL语句 select不用as而如何調用表中的描述??請看例子 怎么样在MSSQL7.0中设置自动执行一个存储过程呢?肯定送分!!! 数据库存图片 求SQL,高手进来试一试!
--birthday date
select * from tb where birthday >='1900-01-01 00:00:00'
select * from tb where birthday >='1900-01-01 00:00:00'
or
select * from tb where birthday >='1900-01-01'都可以
上面的看清楚楼主的要求啊~是1990 不是1900
select * from tb where year(birthday) > 1989
substring(birthday,1,4)是取birthday的年,cast("" as int)是把年的类型转换成int,再和1990进行比较
select * from tb where birthday >='1990-01-01 00:00:00'
select * from table where 生日字段 >='1990-01-01'
select * from table where DATEPART(YEAR,生日字段) > 1989
select * from TB where Year(生日字段) > 1989
set @dd= '1990-10-10'
select year(@dd)
select * from tt where year(dd)>=1990
WHERE DATEDIFF(yy,'1990-1-1',birthday)>=0具体情况,可根据实际做出变化。