求一简单SQL查询语句 从一张员工信息表中查询年龄小于20的,我是这样写的select * from table where ltrim(出生年月日,8,4)>datetime.year-22但找不到结果,运行有误,请各位指教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from table where year(getdate())- year(出生年月日)<20 select * from table where datediff(year,出生年月日,getdate())<20 select * from table where datediff(year,出生年月日,getdate())<20 Create Table 员工信息表 (id int,name varchar(10),出生年月日 datetime)insert 员工信息表 select 1,'a','1981-10-01'insert 员工信息表 select 2,'b','1987-04-05'insert 员工信息表 select 3,'c','1988-04-04'insert 员工信息表 select 4,'d','1976-04-04'insert 员工信息表 select 5,'e','1986-02-04'insert 员工信息表 select 6,'f','1985-06-06'insert 员工信息表 select 7,'g','1956-01-01'select * from 员工信息表 where datediff(year,出生年月日,getdate())<20drop table 员工信息表------------------------id name 出生年月日 ----------- ---------- ------------------------------------------------------ 2 b 1987-04-05 00:00:00.0003 c 1988-04-04 00:00:00.000(所影响的行数为 2 行) select * from table where datediff(day,出生日期,getdate())<365 请问这查找字符串统计 SQL查询 问一个弱智问题,关于数据库中表的关联? 设置小数位数 关于2个事务同时执行的一个问题,麻烦帮看看。 这个SQL语句怎么写 我想问一下就是怎么整理把不同条件下的数据放在一个DBGRID的问题 帮我把这条sql语句简化一下 有关就业方向的问题,大伙给个意见吧! DEVELOPER開發中對DATA BLOCK中不同的ITEM進行相同的操作有什麽好辦法? 关于select语句(查询库存数据) trigger问题
insert 员工信息表 select 1,'a','1981-10-01'
insert 员工信息表 select 2,'b','1987-04-05'
insert 员工信息表 select 3,'c','1988-04-04'
insert 员工信息表 select 4,'d','1976-04-04'
insert 员工信息表 select 5,'e','1986-02-04'
insert 员工信息表 select 6,'f','1985-06-06'
insert 员工信息表 select 7,'g','1956-01-01'select * from 员工信息表 where datediff(year,出生年月日,getdate())<20drop table 员工信息表------------------------
id name 出生年月日
----------- ---------- ------------------------------------------------------
2 b 1987-04-05 00:00:00.000
3 c 1988-04-04 00:00:00.000(所影响的行数为 2 行)