简单的说#{}和${}的区别:$是String 拼接插入的#则是占位符来做处理的,写法比如字符串类型,$需要自己添加''#就不需要添加,对于日志的差别就是$会打印在日志里面,#则显示?
大多数我们都是用#{} 因为可以防止sql注入,但是有时候${}还是很必要的,比如传入tableName,或者fieldName比如Order By id||time 就需要${}传入 #{}就无...
分类:
其他好文 时间:
2015-02-28 00:21:47
阅读次数:
430
需求:有一列NAME, varchar2类型,内容如下以上就是已经按order by name进行排序的,但不是我们所需要的结果现在需要只按数字进行排序第一步:抽取数字由于数字有是一位的有是两位的 所以不好用substr进行截取我们可以使用REGEXP_SUBSTR函数,使用正则表达式从字符串中抽取子串。REGEXP_SUBSTR(name, '[0-9]+')第二步、将varchar类型的数字转...
分类:
数据库 时间:
2015-02-27 22:59:55
阅读次数:
240
1、在order by fetch first中,所有的记录必须从磁盘取出来放入一个叫insert buffer的内部结构,然后进行排序,按照常识我们知道一般树排序的复杂度为O(nlogn), 最好的基数排序的复杂度是O(n),但是也需要额外生成许多复杂的数据结构。而在MAX()语句中,只是使用了s...
分类:
其他好文 时间:
2015-02-27 22:52:12
阅读次数:
173
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 sec...
分类:
其他好文 时间:
2015-02-27 21:34:28
阅读次数:
222
今天有个项目出现了问题 问题原因是union和order by 的问题。关于这个问题的解决方案可以猛击下面的链接。 http://blog.csdn.net/gtuu0123/article/details/5248202
分类:
数据库 时间:
2015-02-27 16:32:21
阅读次数:
192
61. Evaluate the following SQL statements that are issued in the given order:CREATE TABLE emp(emp_no NUMBER(2) CONSTRAINT emp_emp_no_pk PRIMARY KEY,en...
分类:
其他好文 时间:
2015-02-27 16:25:05
阅读次数:
465
https://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/Given a binary tree, return thebottom-up level ordertraversal of its nodes' valu...
分类:
其他好文 时间:
2015-02-27 14:53:37
阅读次数:
133
https://oj.leetcode.com/problems/binary-tree-level-order-traversal/Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from...
分类:
其他好文 时间:
2015-02-27 14:49:54
阅读次数:
178
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it
as a li...
分类:
其他好文 时间:
2015-02-27 11:54:33
阅读次数:
125
When you use the bind option of the mount command, you must be sure that the file systems are mounted in the correct order. In the following example, ...
分类:
其他好文 时间:
2015-02-26 21:33:04
阅读次数:
129