Oracle入門必會(12)

2021-04-19 10:29:27 字數 1767 閱讀 5450

221. translate(char1,char2,char3)

將char1中的char2的部分用char3代替。

select translate('abcdefgh','de','mn') from  dual;

222. upper(char)

將字串char全部為大寫。

223. add_months(d,n)

將n個月增加到d日期。

select add_months(sysdate,5) from dual;

224. last_day(d)

得到包含d日期的月份的最後的一天的日期。

select last_day(sysdate) from dual;

225. month_between(d1,d2)

得到兩個日期之間的月數。

select month_between(d1,d2) from dual;

226. next_day(d,char)

得到比日期d晚的由char命名的第乙個週日的日期。

select next_day(to_date('2003/09/20'),'satday') from dual;

227. rount(d,fmt)

得到按指定的模式fmt捨入到的最進的日期。

select rount('2003/09/20',month) from dual;

228. sysdate

得到當前系統的日期和時間。

select sysdate from dual;

229. to_char(d,fmt)

將日期d轉換為fmt的字串。

select to_char(sysdate,'yyyy/mm/dd') from dual;

230. to_date(char,fmt)

將字串char按fmt的格式轉換為日期。

select to_date('2003/09/20','yyyy/mm/dd') from dual;

231. abs(n)

得到n的絕對值。

select abs(-6) from dual;

232. ceil(n)

得到大於或等於n的最大整數。

select ceil(5.6) from dual;

233. cos(n)

得到n的余弦值。

select cos(1) from dual;

234. sin(n)

得到n的正弦值。

select sin(1) from dual;

235. cosh(n)

得到n的雙曲余弦值。

select cosh(1) from dual;

236. exp(n)

得到n的e的n次冪。

select exp(1) from dual;

237. floor(n)

得到小於或等於n的最小整數。

select floor(5.6) from dual;

238. ln(n)

得到n的自然對數。

select ln(1) from dual;

239. log(m,n)

得到以m為底n的對數。

select log(2,8) from dual;

240. mod(m,n)

得到m除以n的餘數。

select mod(100,7) from dual;

Oracle入門必會(5)

81.內連線inner join?select a.from bsempms a,bsdptms b where a.dpt no b.dpt no 82.如何外連線?select a.from bsempms a,bsdptms b where a.dpt no b.dpt no select a...

Oracle入門必會(7)

121.取時間點的日的寫法 select to char sysdate,dd from dual 122.取時間點的時的寫法 select to char sysdate,hh24 from dual 123.取時間點的分的寫法 select to char sysdate,mi from dua...

Oracle入門必會(9)

162.如何知道表在表空間中的儲存情況?select segment name,sum bytes count ext quan from dba extents where tablespace name tablespace name and segment type table group b...