个人学习工作备忘录

Oracle查询锁死的语句

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;  

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), '')
--------------------- 
 

猜你喜欢

转载自blog.csdn.net/star_kite/article/details/83341160