一个关于剔除重复数据的sql
informix数据库
create table test(
downman varchar(6),--名字
sex varchar(4),--性别
downtime DATETIME YEAR TO FRACTION(5) default CURRENT YEAR TO FRACTION(5) not null--录入时间
);
insert into test(downman,sex) values('杨迎','女');
insert into test(downman,sex) values('杨迎','女');
insert into test(downman,sex) values('婉思','女');
insert into test(downman,sex) values('婉思','女');
insert into test(downman,sex) values('肖杉','男');
如果姓名和性别相同,只输出一个,如上述内容输出结果为:
杨迎 女 2009-10-15 19:18:05.00000
婉思 女 2009-10-16 19:18:05.00000
肖杉 男 2009-10-17 19:18:05.00000
求查询语句
[解决办法]
select downman,sex,max(downtime)from testgroup by downman,sex
[解决办法]
FRACTION(5)?