Oracle数据库的一些简单sql问题

常用三种数据库(sql service,mysql ,oracle)的数据备份

--数据备份
--oracle
create table studentback
as
select *from student

--mysql
create table studentback
select *from student

--SQL service
select *into studentback
from student

--查询4-6条数据库
select *from

 select temp.*,rownum rn from
 (
   select *from student
 )temp
 where rownum<=6
)where rn >=4


--查询id=2的用户的数据
select *from

select name,age,address,rownum rn from student
)temp
where rn=2


--查询name,age均不重复的数据记录
--利用分组 获取信息
select  name,age,count(name|| age) from student
group by name,age
having (count(name|| age)<2)

--查询不重复的学生信息
select distinct id,name,age,address from student

原文地址:https://www.cnblogs.com/sujulin/p/8052479.html