标签:种类 and 查询 账户 login name 统计 userinfo enter
select version as 版本 from cbas_eventdata; 所有select from moncenter.dbo.wt_login_transmid where version = ‘I037.08.146.1.13.0‘ or version = ‘G037.08.55.1.32.9.00‘ 列出这两个版本的所有信息
select count() as 版本 from moncenter.dbo.wt_login_transmid where version = ‘I037.08.146.1.13.0‘ or version = ‘G037.08.55.1.32.9.00‘ 以版本为列标题统计这两个版本的数量
select count(distinct version) as 版本 from moncenter.dbo.wt_login_transmid where version = ‘I037.08.146.1.13.0‘ or version = ‘G037.08.55.1.32.9.00‘ 以版本为列标题统计这两个版本去重后的数量(肯定就是2)
select distinct dlzh from moncenter.dbo.wt_login_transmid where exists
(select * from moncenter.dbo.wt_login_transmid where version = ‘I037.08.146.1.13.0‘ or version = ‘G037.08.55.1.32.9.00‘ ) 列出这两个版本的登陆账户,去重列出,用到嵌入查询exists
select distinct phone as 手机号 ,dlzh as 登陆账户
from moncenter.dbo.wt_login_transmid where exists
(select * from moncenter.dbo.wt_login_transmid where version = ‘I037.08.146.1.13.0‘ or version = ‘G037.08.55.1.32.9.00‘ ) 列出这两个版本的登陆账户及手机号,手机号和登陆账户关联去重,用到嵌入查询exists
查询年薪高于奖金10倍的所有人信息:
selelct from userinfo where nx > jj10;
查询部门10中所有经理和部门20中所有职员信息:
select * from uersinfo wherer (bm=10 and zw=jl) or (bm=20 zw=zy);
查询部门10中所有经理,部门20中所有职员,既不是经理又不是职员但薪金大于2000的所有员工资料:
selelct * from userinfo where (bm=10 and zw=jl) or (bm=20 and zw=zy) or (zw not in (‘jl‘,‘zy‘) and xj >2000 );
找出不收取佣金或收取佣金低于100的员工:
selelct distinct job from userinfo where com is null or com < 100;
显示员工姓名不带R的人
selelct * from where name not like ‘%R%’;
显示姓名包含A所有员工,结果按基本工资从高到低排序,如果相同则按照雇佣年限从老到新排序,如果年限相同 按职务排序。
select * from where name like ‘%A%‘ order by gz desc,hirdate,job;
标签:种类 and 查询 账户 login name 统计 userinfo enter
原文地址:http://blog.51cto.com/12346621/2172787