Like的运用场合主要在模糊查询的时候,一般以查询字符串居多,这里据一些例子来说他的一般用法:《1》查询name字段中包含有“明”字的:例 select * from table1 where name like ‘%明%’ (这里不能使用*来代替,一般在使用0个或者任意个字符构成的字符串的时候最好...
分类:
数据库 时间:
2015-03-07 15:27:48
阅读次数:
152
---正在运行的select a.username, a.sid,b.SQL_TEXT, b.SQL_FULLTEXT from v$session a, v$sqlarea b where a.sql_address = b.address ---运行过的select b.SQL_TEXT,b.F...
分类:
数据库 时间:
2015-03-07 15:24:15
阅读次数:
147
SELECT distinct a.企业名称
,stuff((SELECT ';'+ Tag FROM [JUSFOUN].[dbo].[重庆-贵州企业_处理_整合] WHERE 企业名称=a.企业名称 FOR xml path('')),1,1,'') AS BODY
FROM [JUSFOUN].[dbo].[重庆-贵州企业_处理_整合] a
group by a...
分类:
数据库 时间:
2015-03-07 14:17:02
阅读次数:
126
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
这道题是二分查找树的题目,要把一个有序数组转换...
分类:
其他好文 时间:
2015-03-07 14:15:44
阅读次数:
130
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum =...
分类:
其他好文 时间:
2015-03-07 14:15:19
阅读次数:
123
DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level...
分类:
编程语言 时间:
2015-03-07 11:22:42
阅读次数:
150
Mysql缺省数据库information_schema 在5以上版本可用mysql 需要root 权限测试注入:false意味着查询不可用true代表查询可用字符型:使用如下查询:select * from table where id = '1';' false'' true" false".....
分类:
数据库 时间:
2015-03-07 06:14:19
阅读次数:
164
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...
分类:
其他好文 时间:
2015-03-07 00:52:10
阅读次数:
198
--首先,两个都是用来进行筛选的;--区别在于 1.当分组筛选的时候使用having eg:在emp中,查出最低工资小于1000的部门号select deptno from emp group by deptno having min(sal)<1000; 2.其他情况使用where
分类:
数据库 时间:
2015-03-06 22:06:00
阅读次数:
183
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,Sql 代码 : select id from t where num is nul...
分类:
数据库 时间:
2015-03-06 18:48:04
阅读次数:
162