查询条件表达式要求出生日期在1990年之后

解决方案 »

  1.   


    --birthday  date
    select * from tb where birthday >='1900-01-01 00:00:00'
      

  2.   

    select * from tbl where 生日》='1900-01-01'
      

  3.   


    select * from tb where birthday >='1900-01-01 00:00:00'
    or
    select * from tb where birthday >='1900-01-01'都可以
      

  4.   

    select * from tb where 出生日期>='1990-01-01'
    上面的看清楚楼主的要求啊~是1990 不是1900 
      

  5.   


    select * from tb where year(birthday) > 1989
      

  6.   

    select * from tb where birthday >='1900-01-01 00:00:00'
      

  7.   

    select * from tb where birthday >='1990-01-01 00:00:00'
      

  8.   

    select * from tb where cast(substring(birthday,1,4) as int)>1990
    substring(birthday,1,4)是取birthday的年,cast("" as int)是把年的类型转换成int,再和1990进行比较
      

  9.   


    select * from tb where birthday >='1990-01-01 00:00:00'
      

  10.   

    select * from TB where birthday  like '1990%%'
      

  11.   

    select * from tb where birthday >='1990-01-01'
      

  12.   


    select * from table where 生日字段 >='1990-01-01'
      

  13.   


    select * from table where DATEPART(YEAR,生日字段) > 1989
      

  14.   

    select * from tb where birthday >='1900-01-01'
      

  15.   


    select * from TB where Year(生日字段) > 1989
      

  16.   

    declare @dd datetime 
    set @dd= '1990-10-10'
     select year(@dd)
    select * from tt where year(dd)>=1990
      

  17.   

    楼主,你的问题总给我感觉就是看上去很简单,但是又不知道是不是真的那么简单的感觉。如果你存放日期的列是datatime的话,直接和1990-01-01那个数据相对比就可以啦。
      

  18.   

    select * from 表名 where 出生日期 >= convert(varchar(4),出生日期,120)+'-01-01'
      

  19.   

    select * from tb where birthday >='1900-01-01 00:00:00'
      

  20.   

    各位楼上,请注意,在数据库中查询与日期相关时建议使用函数!!!SELECT * FROM tb 
    WHERE DATEDIFF(yy,'1990-1-1',birthday)>=0具体情况,可根据实际做出变化。