SELECT substr(sys_connect_by_path(dutywork, ';'), 2)
FROM (select dutywork,rownum rn
from t_test)
WHERE connect_by_isleaf = 1
START WITH rn = 1
CONNECT BY prior rn = rn - 1;
查询表t_t...
分类:
数据库 时间:
2015-03-10 15:31:59
阅读次数:
192
explain 可以查看sql语句的执行情况,可以看到每个条件扫描的行数,当系统内需要使用SQL查询时,通过explain看下该语句的性能。1.索引通常被用于提高WHERE条件的数据行匹配或者执行联结操作时匹配其它表的数据行的搜索速度。所以我们选择索引的列也通常选择出现在WHERE子句、join子句...
分类:
数据库 时间:
2015-03-10 13:56:16
阅读次数:
147
select * from (select count(name) as isone, name from tbl_org_departments group by name) t where t.isone > 1;执行子句时结果:下面是没使用分组的时候结果
分类:
数据库 时间:
2015-03-10 11:58:20
阅读次数:
145
数据库已知一条数据的ID,如何查询下条数据且ID不同 首先ID已知一条,假如得到的为“1001”,下条的数据ID有可能相同,有可能不相同,如何查询?如果直接查询 “Select * from 表名 where 列名ID='1001'”就只能查询本身的一条数据,添加“top 2”,也会只有一条数据。可...
分类:
数据库 时间:
2015-03-10 11:54:44
阅读次数:
240
Valid Sudoku问题:Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells a...
分类:
其他好文 时间:
2015-03-10 10:18:29
阅读次数:
162
启动gdb 程序名 [corefile]corefile 是可选的,能增强gdb的调试能力。linux默认不生成corefile的。所以需要在.bashrc文件中添加ulimit -c unlimitedsh .bashrc 生效脚本gdb -q 程序名 core.xxxxrun命令where命令l...
分类:
数据库 时间:
2015-03-09 23:50:03
阅读次数:
190
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:
其他好文 时间:
2015-03-09 22:09:40
阅读次数:
229
A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, in that cas...
分类:
其他好文 时间:
2015-03-09 21:00:37
阅读次数:
157
http://acm.hdu.edu.cn/showproblem.php?pid=1151
Problem Description
Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also know...
分类:
其他好文 时间:
2015-03-09 20:55:01
阅读次数:
145
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.知识点:二叉搜素树: 1. 如果root有左子节点,则所有左边的节点root; 3. root.lef.....
分类:
其他好文 时间:
2015-03-09 20:48:13
阅读次数:
182