日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle一句话倒过来,oracle一些基本语句

發布時間:2023/12/15 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle一句话倒过来,oracle一些基本语句 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

--復制表

create table stuBak

as select * from stuInfo;

--復制表結構

create table stuBak2

as select * from stuInfo where 1=2;

--在已有的表結構中插入數據

insert into stuBak2

select * from stuBak;

update stuBak set s_sex=’男’;

savepoint mark;

rollback to savepoint mark;

rollback;

--給予其他用戶權限

connect scott/tiger@itjob;

grant select on emp to yangrs; --只給查詢

grant all on emp to yangrs --給所有的權限

connect yangrs/yangrs@itjob;

select * from scott.emp;

-- 取消權限

connect scott/tiger@itjob;

revoke select on emp from yangrs;

connect yangrs/yangrs@itjob;

select * from scott.emp; --此時已經連接不上去了

--偽列 rowid rownum

select rowid,rownum from stuInfo;

--用于分頁

select * from (select rownum as num,stuInfo.* from stuInfo) where num>5;

--sqlserver中是使用top來分頁

--啞元表

select sysdate from dual;

select systimestamp from dual;

--對表的修改

alter table stuInfo add(s_sal number(3));

--is null and is not null

select * from stuInfo where s_note is null;

select * from stuInfo where s_name like ’y%’; --%代筆任意個字符

select * from stuInfo where s_name like ’y_’; --—_代表一個字符

select * from stuInfo where s_name like ’y?’;

select * from stuInfo order by s_age desc; -- 排序

select * from stuInfo order by s_birthday asc;

select * from stuInfo order by s_age desc,s_birthday asc;

--可以有兩個條件

--分組

select * from stuInfo where s_name<>’yangrs’;

select * from stuInfo where s_age=19;

select * from stuInfo where s_name<>’yangrs%’; --這樣是不行的

--調用函數

select sum(s_sal) as 獎學金 from stuInfo;

select avg(s_age) 平均年齡 from stuInfo;

select s_name,s_age from stuInfo group by s_age;

select ’hell’||’loworld’ from dual;

select 1+1 from dual;

--轉換大小寫

update stuInfo set s_name=upper(s_name);

update stuInfo set s_name=lower(s_name);

--轉換ascii碼

select ascii(’A’) from dual;

select ’Hello’||’\t’||’World’ from dual;

select ’Hello’||chr(9)||’World’ from dual;

select to_char(sysdate,’yyyy/mm/dd hh24:mi:ss’) from dual;

select add_months(sysdate,-12) from dual;

-- 一年以前的今天

select last_day(sysdate) from dual;

select to_char(sysdate,’yyyy/mm/dd’) from dual; --改變日期格式

select to_char(to_date(’19990214’,’yyyymmdd’),’yyyy"我"mm"月"dd"日"’) from dual;

select to_char(to_date(’19990214’,’yyyymmdd’),’yyyy"我"mm"月"dd"日"’) from dual;

ref:http://www.zlksw.cn/html/jsj/Oraclerenzheng/xuexiziliao/200812/24-7834.html

posted on 2008-12-26 10:40 Tiger1102 閱讀(447) 評論(0) ?編輯 ?收藏 所屬分類: 程序人生

總結

以上是生活随笔為你收集整理的oracle一句话倒过来,oracle一些基本语句的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。