[ORACLE]ORACLE 实现mysql中的limit 功能
项目从mysql迁移到ORACLE中遇到移植问题,mysql中支持limit 而ORACLE say no .
解决方法 利用ORACLE的伪列 rownum来控制。。
Mysql : select * from table limit 10
equl
ORACLE: select * from table where rownum <= 10
ORACLE 伪列介绍:
随数据字典一起自动创建的一个表,属于sys模式,任何用户都可以访问, 只有一列dummy(varchar2(1)),返回值也只有一行,
因此,在进行select 计算常量表达式或者伪列时常常用到.
oracle中的常用到的伪列:
序列
currval:序列當前值
nextval:序列的新值
level:层次查询中的层数
rowid:特定的行表識符
rownum:行序號
用法:
序列:
create sequence sequence1;
currval:
select sequence1.currval from dual;
nextval:
select sequence1.nextval from dual;
在insert
into中也可以:
insert into tableName(id1)
values(sequence1.nextval);
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96524/c21cnsis.htm#2937
Types of Locks
Oracle automatically uses different types of locks to control concurrent access to data and to prevent destructive interaction between users. Oracle automatically locks a resource on behalf of a tran ......
-- Create the user
create user SMCQUERY
identified by SMCQUERY;
-- Grant/Revoke role privileges
grant connect to SMCQUERY;
-- Grant/Revoke system privileges
grant select any table to SMCQUERY;
grant debug any procedure to SMCQUERY;
grant debug connect session to SMCQUERY;
grant cr ......
最近了解了一下MYSQL注入,也实际操作了一下,确实发现了他的威力。
一个注入漏洞可以让人直接拿到服务器权限。
总结一下:
1,目录的权限不能太高,不然别人能往里写文件,以前用0777真是太愚蠢了。
2,严格过滤数据,整形一律转int或用mysql_escape_string
3,设置合理的数据库权限,不要用ROOT,不然会死得很惨。
4 ......
http://www.3d308.cn/article.asp?id=37
shell> mysql -u root mysql
mysql> Update user SET Password=PASSWORD('new_password')
Where user='root';
mysql> FLUSH PRIVILEGES;
......