Oracle查询锁死的语句
//查询死锁的sid和serial定位一条死锁记录
SELECT s.sid, s.serial# FROM v$locked_object lo, dba_objects ao, v$session s WHERE ao.object_id = lo.object_id AND lo.session_id = s.sid;
//查询死锁的记录,以及对这条记录进行操作的用户
SELECT s.username,l.OBJECT_ID,l.SESSION_ID,s.SERIAL#,
l.ORACLE_USERNAME,l.OS_USER_NAME,l.PROCESS
FROM V$LOCKED_OBJECT l,V$SESSION S WHERE l.SESSION_ID=S.SID;
Oracle杀死被锁死的语句
ALTER system KILL session 'SID,serial#';
sql分组查询最大的记录
1.
select * from test as a
where typeindex = (select max(b.typeindex)
from test as b
where a.type = b.type );
2.
select
a.* from test a,
(select type,max(typeindex) typeindex from test group by type) b
where a.type = b.type and a.typeindex = b.typeindex order by a.type
表格tbody滚动条
#table2 为需要给tbody添加滚动条的表格
#table2 tbody{
height:750px;
overflow:auto;
display:block;
}
#table2 thead,#table2 tbody tr{
display: table;
width: 100%;
table-layout: fixed;
}
文本溢出省略号
.selectandsearch{
width:270px;
box-sizing:border-box;
overflow:auto;
overflow-x:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
移除sql语句中的换行符和回车符
--移除回车符
update master_location
SET street_number = REPLACE(street_number, CHAR(13), '')
--移除换行符
update master_location
SET street_number = REPLACE(street_number, CHAR(10), '')
---------------------