update vouchers b ,( select a.id from ?vouchers a ?where a.reason=‘XX‘ and a.id not in ( select minid from ( SELECT min(id)minid, userid FROM vouchers WHERE reason = ‘XX‘ GROUP BY userid ) ss ) ...
分类:
数据库 时间:
2015-05-28 16:28:31
阅读次数:
300
1.1 全排序
Hive的排序关键字是SORT BY,它有意区别于传统数据库的ORDER BY也是为了强调两者的区别–SORT BY只能在单机范围内排序。[/url][王黎1]
1.1.1 例1
set mapred.reduce.tasks=2;
原值
select cookie_id,page_id,id fromc02_clickstat_fatdt1
where c...
分类:
编程语言 时间:
2015-05-28 16:15:06
阅读次数:
237
select * from call_cdr_xz_200609 a where and a.ori_charge0 and exists(select 1 from special b where a.called_nbr like b.special_nbr||'%' and b.billi.....
分类:
数据库 时间:
2015-05-28 15:39:46
阅读次数:
182
ORDER BY Optimization 某些情况下,MYSQL可以使用index排序而避免额外的sorting. 即使order by语句列不能准确的匹配index,只要没有index中(不在order by的列)在where语句以常量形式出现。(最左前缀)SELECT * FROM t1...
分类:
数据库 时间:
2015-05-28 12:28:21
阅读次数:
150
having子句可以让我们筛选成组后的各种数据,having子句在查询过程中慢于聚合语句having的用法having子句可以让我们筛选成组后的各种数据,having子句在查询过程中慢于聚合语句(sum,min,max,avg,count).而where子句在查询过程中则快于聚合语句(sum,min...
分类:
其他好文 时间:
2015-05-28 00:32:53
阅读次数:
144
Group by,where,having 是数据库查询中最常用的几个关键字。在工作中,时常用到,前面遇到一个问题,一个查询中使用了where ,group by ,having及聚集函数时 ,执行顺序是怎么样的?为了回答这个问题,将这个三个关键字的用法整理一下。Where:数据库中常用的是Wher...
分类:
数据库 时间:
2015-05-28 00:21:48
阅读次数:
205
1、查询语句尽量不要使用select *等操作,原因:避免查询出不必要的数据,避免表结构变化后sql语句出错2、对where, group by,order by等后面的字段加索引来提高速度,但索引不能太多。3、了解数据库设计的几个范式,但是设计时有时候需要适当的违法范式来提高数据操作性能,如:通过...
分类:
数据库 时间:
2015-05-27 22:30:15
阅读次数:
130
注:存储过程和函数的区别:存储过程没有返回值。
查看存储过程 show procedure status \G
删除存储过程drop procedure 存储过程名
创建存储过程
create procedure 存储过程名(n int)
begin
if j='h' then
select * from g where num>n;
else
select * from g wh...
分类:
数据库 时间:
2015-05-27 21:09:30
阅读次数:
151
搜索: user-defined例子。# save this file in ~/.gdb or some where easy to find.# then in ~/.gdbinit add the following line...# source ~/.gdb/osip_gdb_util##...
分类:
其他好文 时间:
2015-05-27 21:03:04
阅读次数:
103
[11]缺少动态连接库.so--cannotopensharedobjectfile:Nosuchfileordirectory
总结下来主要有3种方法:1.用ln将需要的so文件链接到/usr/lib或者/lib这两个默认的目录下边ln-s/where/you/install/lib/*.so/usr/libsudoldconfig2.修改LD_LIBRARY_PATHexportLD_LIBRARY_..
分类:
其他好文 时间:
2015-05-27 19:22:45
阅读次数:
174