日期:2014-05-16 浏览次数:20519 次
三个设置为主键的字段:c_year,c_parent,c_name
--找出重复的行
select *
from t_qq9_gdp t
where
rowid != (select max(rowid)
from t_qq9_gdp t2
where t.c_year = t2.c_year
and t.c_parent = t2.c_parent
and t.c_name = t2.c_name);
--选出重复的行
select *
from t_qq9_gdp t
where t.c_year = '2002'
and t.c_parent = '拉丁美洲和加勒比海地区'
and (t.c_name = '多米尼加共和国' or t.c_name = '危地马拉');select c_nme,count(*) as aa from tb_user_info t group by c_nme,c_pwd,c_enabled order by aa desc