在删除数据表的时候往往遇到外键约束无法删除的情况,我们可以通过以下几步将数据库表删除,建议在删除库之前先对数据库进行备份,养成良好习惯。1.删除外键--查询用户所有表的外键,owner条件为userselect * from user_constraints c where c.constraint...
分类:
数据库 时间:
2015-03-17 00:40:07
阅读次数:
266
方法一:通过配置文件 delete from users where id=#{id} update users set name=#{name}, age=#{age} where id=#{id} ...
分类:
其他好文 时间:
2015-03-17 00:32:55
阅读次数:
178
一. 使用for循环游标:
1. 定义游标(游标就是一个小集合)
2. 定义游标变量
3. 使用for循环游标
declare
-- 定义游标c_job
cursor c_job is
select empno, ename, job, sal from emp where job = 'MANAGER';
-- 定义游标变量c_row
c_row c_j...
分类:
数据库 时间:
2015-03-16 23:10:03
阅读次数:
212
1 用mysql客户端登入2 选择数据库 mysql>use test3 查询当前数据库有哪些存储过程 mysql>show procedure status where Db='test'4 创建一个简单的存储过程 mysql>create procedure hi() select 'he...
分类:
数据库 时间:
2015-03-16 23:02:02
阅读次数:
207
public function show_list_by_order($array_data, $order_field, $order_mode) { $query = $this->db->get_where('xm_attach', $array_data); ...
分类:
其他好文 时间:
2015-03-16 21:12:40
阅读次数:
172
Given a sequence of K integers { N1, N2, ..., NK}. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj} where 1 5 #include 6 #include 7 #...
分类:
其他好文 时间:
2015-03-16 19:10:05
阅读次数:
109
http://blog.csdn.net/yangyu112654374/article/details/4251624比如一条sql语句select * from TABLE1 where A1=1 and A2=2 and A3=3 order by A4 ASC;优化后是这样: select ...
分类:
数据库 时间:
2015-03-16 19:07:27
阅读次数:
539
(1)规格型号不为空:select * from sm_zdb_xtwl_TB t where exists( select 1 from sm_zdb_xtwl_TB where ID != t.ID and WLMC=t.WLMC and GGXH=t.GGXH) (2)规格型号为空:...
分类:
其他好文 时间:
2015-03-16 16:14:59
阅读次数:
124
很多使用织梦dedecms单页文档功能的朋友都想知道如何在织梦首页调用单页文档的内容,下面就教大家具体的实现方法:具体步骤如下:首先在首页模板需要显示单页文档内容的地方插入如下代码:{dede:sql sql="SELECT body FROM `dede_sgpage` where aid = 3...
分类:
其他好文 时间:
2015-03-16 16:01:32
阅读次数:
135
--删除表中重复记录大于两条保存两条delete from t_Cht_clm_reg F where F.case_id in (select T.case_id from (select B.* from (select e.* , row_number() over (partition b....
分类:
其他好文 时间:
2015-03-16 15:48:47
阅读次数:
100