当前位置:首页 » 编程语言 » oracle经典sql

oracle经典sql

发布时间: 2022-07-06 00:57:49

Ⅰ 求oracle长用和特有的sql语句

SELECT TO_DATE('2010-01-01','YYYY-MM-DD') + LEVEL - 1 CUR_DATE
FROM DUAL
CONNECT BY LEVEL <= TO_DATE('2010-02-10','YYYY-MM-DD') - TO_DATE('2010-01-01','YYYY-MM-DD') + 1

Ⅱ 一个简单的oracle sql 语句

打印出空值的原因很简单,oracle中
rownum永远按照默认的顺序生成,并且rownum只能使用<
<=,不能使用>
>=。
可以这样写:select
*

2
from
(select
rownum
r,e.*

3

from
(select
*
from
emp
order
by
sal)
e

4

where
rownum
<=8

5

)

6
where
r
>=5;
经过子查询后,此时的别名r只是一个普通的字段,就不再是按照默认生成的了

Ⅲ Oracle 经典的SQL语句,供大家参考,大家提提意见!

select × from v$sqlarea
查询最近使用的sql语句

学习了!!

Ⅳ oracle sql语句 分为哪些

Oracle SQL语句分类
SQL(Structured Query Language)即结构化查询语句,应用程序与数据库交互的接口
集数据操作、数据定义、数据控制等功能于一体
ANSI先后制定推出了SQL-89、SQL-92、SQL-99标准

oracle SQL 语句主要分为一下四类:

DML(Data Mannipulation Language)数据操纵语言:查询、操纵数据表资料行
SELECT : 检索数据库表或视图数据
INSERT : 将数据行新增至数据库表或视图中
UPDATE : 修改表或视图中现有的数据行
DELETE : 删除表或视图中现有的数据行
注意:DML语句不会自动提交事务!

DDL(Data Definition Language)数据定义语言:建立、修改、删除数据库中数据表对象
CREATE TABLE : 创建表
ALTER TABLE : 修改表
DROP TABLE : 删除表
注意:DLL语句会自动提交事务!所以:DML语句事务提交之前可以回滚,DDL语句不能回滚事务

DCL(Data Control Language)数据控制语言:用于执行权限授予与收回操作
GRANT : 给用户或角色授予权限
REVOKE : 收回用户或角色的所有权限

TCL(Transactional Control Language)事物控制语言:维护数据的一致性
COMMIT :提交已经进行的数据库改变
ROLLBACK : 回滚已经进行的数据改变
SAVEPOINT : 设置保存点,用于部分数据改变的取消

Ⅳ ORACLE SQL语句

创建表插入数据:

createtabletest
(wy1int,
wy2int,
wy3int,
wy4int);

insertintotestvalues(1,11,4,5);
insertintotestvalues(2,22,4,6);
insertintotestvalues(3,33,4,5);
insertintotestvalues(4,444,null,null);
insertintotestvalues(5,555,null,null);
insertintotestvalues(6,666,null,null);
commit;

执行:

selectt1.wy1,t1.wy2,t2.wy2wy3,t3.wy2wy4
fromtestt1
leftjointestt2
ont2.wy1=t1.wy3
leftjointestt3
ont3.wy1=t1.wy4
orderbywy1;

结果:

Ⅵ oracle的sql语句如下

DAYS在哪?你前面虽然命名了别名,但是 TJ_XIANGMU_JIAOYIE中并没有这个名字。要是真的想按照days分组,那么方法是
SELECT
TO_CHAR(FABU_TIME,'yyyymmdd') AS days
FROM
TJ_XIANGMU_JIAOYIE
GROUP BY TO_CHAR(FABU_TIME,'yyyymmdd')

Ⅶ Oracle SQL经典着作除了《Oracle SQL高级编程》外,还有哪些

其实Oracle SQL最经典的不是这本书,而是《Oracle PL/SQL程序设计》不知道已经印到第几版了,应该至少也有第五版了吧。

看了这本藐视其它相关PL/SQL书籍,哈哈,夸张了

Ⅷ oracle sql查询语句

oracle sql查询语句
可通过查询all_tables这个系统表来查看数据库中的所有表。 执行语句: select table_name from all_tables;查询结果:

Ⅸ oracle sql 语句

1. select top 1 *from (select count(BId) as cc from brrow where getdate() between T_time and B_time group by stuID) order by cc desc
2.select a.stuname,b.title,b.T_time,b.B_time from student a join
(select borrow.stuID,borrow.T_time,borrow.B_time,book.title from borrow join book on borrow.BID=book.bid) b on a.stuID =b.stuID
3.select *from student where stuID not in (select stuid from borrow where gedate() >B_time)
4.
go
create proc login
@stuid number(10),
@password varchar2(20),
@re varchar(20) output
as
declare @st number
select @st = stuid from student where stuid=@st
if isnull(@st,0)=0 return '-1'
else if @password = (select password from student where stuid =@stuid) and @password is not null rturn '0'
else return select stuname from student where stuid =@stuid
go
5.go
create function dd()
@bid number(10)
as
if ((select bid from borrow where bid =@bid) is not null )
begin
print '必须先删除借书信息记录表中所有对应于该图书的所有数据'
return
end
delete from book where bid =@bid
go

热点内容
滑板鞋脚本视频 发布:2025-02-02 09:48:54 浏览:433
群晖怎么玩安卓模拟器 发布:2025-02-02 09:45:23 浏览:557
三星安卓12彩蛋怎么玩 发布:2025-02-02 09:44:39 浏览:744
电脑显示连接服务器错误 发布:2025-02-02 09:24:10 浏览:537
瑞芯微开发板编译 发布:2025-02-02 09:22:54 浏览:147
linux虚拟机用gcc编译时显示错误 发布:2025-02-02 09:14:01 浏览:240
java驼峰 发布:2025-02-02 09:13:26 浏览:652
魔兽脚本怎么用 发布:2025-02-02 09:10:28 浏览:538
linuxadobe 发布:2025-02-02 09:09:43 浏览:212
sql2000数据库连接 发布:2025-02-02 09:09:43 浏览:726