151027
2015-10-28 08:55
316 查看
select t.*, t.rowid from T_HQ_RYXX t select nianl,xingm from t_hq_ryxx; select nianl as 年龄,xingm as 姓名 from t_hq_ryxx ; select nianl 年龄 from t_hq_ryxx; select nianl || xingm as 年龄和姓名 from t_hq_ryxx; select nianl as g, t.* from t_hq_ryxx t order by xingb desc,bum nulls; select * from t_hq_ryxx order by 2; select * from t_hq_ryxx order by (gongz + nianl) desc; select distinct bum,nianl from t_hq_ryxx; select * from t_hq_ryxx; select * from t_hq_ryxx where bum = '102' or bum = '101' and xingb = '2' select * from t_hq_ryxx where bum is not null; --模糊查询 %通配符 _通配一位 select * from t_hq_ryxx where xingm like'%的%'; select * from t_hq_ryxx where xingm like'神__'; --值的范围 select * from t_hq_ryxx where nianl in ('11','66'); select * from t_hq_ryxx where nianl = '11' or nianl ='66'; --区间范围 select * from t_hq_ryxx where gongz between 10 and 800; select * from t_hq_ryxx where gongz >= 100 and gongz <=300; select * from t_hq_ryxx where bum in (select bumbm from t_hq_bm where lianxi = '545'); --大于最小值 小于最大值 select * from t_hq_ryxx where gongz > any (select pingjgz from t_hq_bm); --大于最大值 小于最小值 select * from t_hq_ryxx where gongz < all (select pingjgz from t_hq_bm); --分组 select bum, count(1) as 数量, avg(gongz) as 平均值, sum(gongz) as 合计 from t_hq_ryxx group by bum having avg(gongz) > 100;
相关文章推荐
- java的split的坑,会忽略空值
- 原Android系统开发时常用linux的命令
- Winxp系统无法使用“添加或删除程序”怎么办 xp系统“添加或删除程序”无法使用的解决
- 面试题
- Xcode上传App到Appstore,报错Error ITMS-90049:"This bundle is invalid.The bundle...."
- 支持向量机通俗导论
- 题1
- 【多图】Google工程师解析Android系统架构--what is android(转载)
- iOS 9 新特性之实现 3D Touch 就是 So easy -- OC版
- 为什么你明明知道,却偏偏做不到?
- linux命令free详解
- UVa307Sticks
- Linux FC SAN存储服务器搭建 SCSI Target (HBA卡)
- mysql中int、bigint、smallint 和 tinyint的区别详细介绍
- ProgressDialog和Handler结合运用显示加载对话框
- android中xliff的使用
- OC 消息机制本质
- XCode 报错 library not found for -lAFNetworking
- Inotify测试(1):PyInotify、Thread测试
- 动态修改Python类和实例的方法(转)