DECLARE c1 cursor for select 'alter table ['+ object_name(parent_obj) + '] drop constraint ['+name+']; ' from sysobjects where xtype = 'F'ope...
分类:
数据库 时间:
2014-07-03 09:19:58
阅读次数:
273
1、删除所有表use 数据库declare @tname varchar(8000)set @tname=''select @tname=@tname + Name + ',' from sysobjects where xtype='U'select @tname='drop table ' + ...
分类:
数据库 时间:
2014-07-03 07:16:59
阅读次数:
214
所谓分页,从数据库中分,则是封装一个分页类。利用分页对象进行分页。但,分页往往带查询条件。分页类的三个重要数据:【当前页码数】,【数据库中的总记录数】,【每页显示的数据的条数】原理:select * from 【表名】 where 【字段名】 like 【'%条件%'】 limit 【开始查询的索....
分类:
系统相关 时间:
2014-07-02 23:06:39
阅读次数:
301
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array....
分类:
其他好文 时间:
2014-07-01 15:22:44
阅读次数:
140
题目
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
方法
public ListNode de...
分类:
其他好文 时间:
2014-07-01 11:30:58
阅读次数:
200
1.float类型
float列类型默认长度查不到结果,必须指定精度,
比如 num float, insert into table (num) values (0.12); select * from table where num=0.12的话,empty set。
num float(9,7), insert into table (num) values (0.12); selec...
分类:
数据库 时间:
2014-07-01 11:09:56
阅读次数:
308
题目
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of gas
to travel from s...
分类:
其他好文 时间:
2014-07-01 11:02:24
阅读次数:
158
典型的排序检索问题,需要注意的是返回排好序后要找的第一次出现的位置(序号是从1开始数的)。开始不知道bsearch()函数,所以自己写了个二分查找,用来用bsearch也同样A过去了。貌似自己写的比库函数还快0.001秒,嘎嘎!Where is the Marble?Raju and Meenalo...
分类:
其他好文 时间:
2014-07-01 10:22:25
阅读次数:
187
今天一个开发问到一个not exists问题,小小做个实验
实验1
SQL> select * from emp e1 where not exists (select 1 from emp e2 where e1.mgr = e2.empno);
EMPNO ENAME JOB MGR HIREDATE ...
分类:
其他好文 时间:
2014-07-01 06:59:39
阅读次数:
164