
sql
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 评论 -
一个Oracle面试题目 [日期间隔按格式输出]
题目: 输入4个值[2008,12,2009,2], 要求一段SQL, 不另创新表, 得到如下结果: 12 2008-12-1 2008-12-31 01 2009-1-1 2009-1-31 02 2009-2-1 2009-2-28 条件: 起始年, 起始月, 截至年, 截至月 结果: 月份, 月的第一天, 月的最后一天 解答: Sql代码 select to_char(tt.d, "mm")...原创 2011-10-07 00:35:40 · 191 阅读 · 0 评论 -
MySQL创建方法错误:This function has none of DETERMINISTIC, NO SQL
创建function时出错信息:ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe l...原创 2011-12-22 16:04:17 · 128 阅读 · 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 评论