
数据库
applejian
这个作者很懒,什么都没留下…
展开
-
关于两个日期间隔工作日的oracle sql实现
sysdate是系统时间 xx.dd是从数据库表中取出的时间,执行结果取出所有当前系统时间在5个工作日以后的结果集。 select * from tableName where (trunc(sysdate -x.dd) - ((case WHEN (8 - to_number(to_char(x.dd, 'D'))) >trunc(sysdate - x.dd) ...原创 2011-10-07 00:12:14 · 375 阅读 · 0 评论 -
Column 'id' in field list is ambiguous
Column 'id' in field list is ambiguous,今天在执行一条SQL时报错了,错误原因是在查询的字段前面没有指定是哪个表,所以Mysql不知道你要查询哪个字段。在google翻译中查了下ambiguous的意思,这个词表示暧昧。哈哈,可别瞎玩暧昧,连没感情的Mysql都是伤不起,人你能伤的起么?...原创 2012-04-23 18:20:41 · 424 阅读 · 0 评论 -
ibatis 的缓存
iBatis的缓存配置比较简单易懂,以我使用的iBatis2.3为例,做以下配置即可实现对某些查询进行缓存: 1、在sqlMap文件中加入cacheModel的配置: <cacheModel id="model-cache" type="MEMORY" > <flushInterval seconds="60"/> ...原创 2012-02-06 14:27:18 · 99 阅读 · 0 评论 -
MYSQL索引优化和in or替换为union all
使用UNION ALL代替OR,这不是绝对的。具体什么时候选择谁,需要看测试数据。一个文章库,里面有两个表:category和article。category里面有10条分类数据。article里面有20万条。article里面有一个"article_category"字段是与category里的"category_id"字段相对应的。article表里面已经把 article_categor...原创 2012-02-07 17:08:16 · 412 阅读 · 0 评论 -
ibatis的remapResults属性合理运用
Proper Usage of remapResults="true"The remapResults attribute is available on 【statement】, 【select】, and 【procedure】 mapped statements. It is an optional attribute and the default value is false.T...原创 2012-03-31 15:51:49 · 154 阅读 · 0 评论