Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQLServerºÍOracleµÄ³£Óú¯Êý¶Ô±È

1.¾ø¶ÔÖµ
S:select abs(-1) value
O:select abs(-1) value from dual
2.È¡Õû(´ó)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£©
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.È¡Õû£¨½ØÈ¡£©
S:select cast(-1.002 as int) value
O:select trunc(-1.002) value from dual
5.ËÄÉáÎåÈë
S:select round(1.23456,4) value 1.23460
O:select round(1.23456,4) value from dual 1.2346
6.eΪµ×µÄÃÝ
S:select Exp(1) value 2.7182818284590451
O:select Exp(1) value from dual 2.71828182
7.È¡eΪµ×µÄ¶ÔÊý
S:select log(2.7182818284590451) value 1
O:select ln(2.7182818284590451) value from dual; 1
8.È¡10Ϊµ×¶ÔÊý
S:select log10(10) value 1
O:select log(10,10) value from dual; 1
9.ȡƽ·½
S:select SQUARE(4) value 16
O:select power(4,2) value from dual 16
10.ȡƽ·½¸ù
S:select SQRT(4) value 2
O:select SQRT(4) value from dual 2
11.ÇóÈÎÒâÊýΪµ×µÄÃÝ
S:select power(3,4) value 81
O:select power(3,4) value from dual 81
12.È¡Ëæ»úÊý
S:select rand() value
O:select sys.dbms_random.value(0,1) value from dual;
13.È¡·ûºÅ
S:select sign(-8) value -1
O:select sign(-8) value from dual -1
----------Êýѧº¯Êý
14.Ô²ÖÜÂÊ
S:SELECT PI() value 3.1415926535897931
O:²»ÖªµÀ
15.sin,cos,tan ²ÎÊý¶¼ÒÔ»¡¶ÈΪµ¥Î»
ÀýÈ磺select sin(PI()/2) value µÃµ½1£¨SQLServer£©
16.Asin,Acos,Atan,Atan2 ·µ»Ø»¡¶È
17.»¡¶È½Ç¶È»¥»»(SQLServer£¬Oracle²»ÖªµÀ)
DEGREES£º»¡¶È-¡µ½Ç¶È
RADIANS£º½Ç¶È-¡µ»¡¶È
---------ÊýÖµ¼ä±È½Ï
18. Ç󼯺Ï×î´óÖµ
S:select max(value) value from
(select 1 value
union
select -2 value
union
select 4 value
union
select 3 value)a
O:select greatest(1,-2,4,3) value from dual
19. Ç󼯺Ï×îСֵ
S:select min(value) value from
(select 1 value
union
select -2 value
union
select 4 value
union
select 3 value)a
O:select least(1,-2,4,3) value from dual
20.ÈçºÎ´¦ÀínullÖµ(F2ÖеÄnullÒÔ10´úÌæ)
S:select F1,IsNull(F2,10) value from Tbl
O:select F1,nvl(F2,10) value from Tbl
     --------ÊýÖµ¼ä±È½Ï-----------------


Ïà¹ØÎĵµ£º

ORACLE ÖÐROWNUMÓ÷¨×ܽá

  ¶ÔÓÚ Oracle µÄ rownum ÎÊÌ⣬ºÜ¶à×ÊÁ϶¼Ëµ²»Ö§³Ö>,>=,=,between...and£¬Ö»ÄÜÓÃÒÔÉÏ·ûºÅ(<¡¢<=¡¢!=)£¬²¢·Ç˵ÓÃ>,>=,=,between..and ʱ»áÌáʾSQLÓï·¨´íÎ󣬶øÊǾ­³£ÊDz鲻³öÒ»Ìõ¼Ç¼À´£¬»¹»á³öÏÖËƺõÊÇĪÃûÆäÃîµÄ½á¹ûÀ´£¬ÆäʵÄúÖ»ÒªÀí½âºÃÁËÕâ¸ö rownum αÁеÄÒâÒå¾Í²»Ó¦¸Ã¸Ðµ½¾ªÆ棬ͬÑùÊÇαÁУ¬r ......

Oracle ×Ö·û´®³¤¶Èº¯Êý


LENGTH calculates length using characters as defined by the input character set. 
LENGTHB uses bytes instead of characters. 
VSIZE returns the number of bytes in the internal representation of expr.
LENGTHC uses Unicode complete characters. 
LENGTH2 uses UCS2 codepoints. 
......

oracleǶÌ×

Ò»¡¢Ç¶Ì×±íµÄ¶¨Ò壺
    ǶÌ×±íÊDZíÖÐÖ®±í¡£Ò»¸öǶÌ×±íÊÇijЩÐеļ¯ºÏ£¬ËüÔÚÖ÷±íÖбíʾΪÆäÖеÄÒ»ÁС£¶ÔÖ÷±íÖеÄÿһÌõ¼Ç¼£¬Ç¶Ì×±í¿ÉÒÔ°üº¬¶à¸öÐС£ÔÚijÖÖÒâÒåÉÏ£¬ËüÊÇÔÚÒ»¸ö±íÖд洢һ¶Ô¶à¹ØϵµÄÒ»ÖÖ·½·¨¡£¿¼²éÒ»¸ö°üº¬²¿ÃÅÐÅÏ¢µÄ±í£¬ÔÚÈκÎʱ¼äÄÚÿ¸ö²¿ÃÅ»áÓкܶàÏîÄ¿ÕýÔÚʵʩ¡£ÔÚÒ»¸öÑϸñµÄ¹ØϵģÐÍÖУ ......

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü
ÉÏһƪ / ÏÂһƪ  2008-09-04 11:25:01
²é¿´( 1991 ) / ÆÀÂÛ( 0 ) / ÆÀ·Ö( 0 / 0 )
ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
select * from v$version;
²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_ ......

sqlserver »ù´¡ÖªÊ¶´óÕûÀí

--(¿ªÆôSQL·þÎñ£ºnet start mssqlserver)
--(ÔÚÃüÁîÐÐÖÐÊäÈë'sqlwb'ÃüÁî¿É´ò¿ªSQL¹ÜÀíÆ÷ )
--(Èç¹ûÒªÖ´ÐжàÌõÃüÁîÖеÄÒ»Ìõ,Êó±êÑ¡¶¨ºóÔÙ°´F5Ö´ÐÐ)
create database sales                       & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ