锁表查询的代码有以下的形式:
select count(*) from v$locked_object;
select * from v$locked_object;
查看哪个表被锁
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.object_id;
查看是哪个session引起的
--create
alter trigger [dbo].[trigger_sqsj]
on [dbo].[lctnrcrd]
after INSERT as
BEGIN
declare @id char(50)
select @id = (select top 1 id from [lctnrcrd] order by CONVERT(char(16),dlr,120) desc)
print @id
delete from [lctnrcrd]
--select * fro
一、语法执行顺序
书写顺序
select id,name from emp where id > 3 and id < 6;
执行顺序
from # 确定到底是哪站表
where # 根据过来条件 筛选数据
select # 拿出筛选出来的数据中的某些字段
select * from emp\G; 当表字段特别多的时候,打印结果的排版可能会出现混乱的现象,这时在查询语句加\G来规范查询结果。
二、常用查询语句
1.where约束条件
1.查询id大于等于3小于等于6的数据
select * fr