SQL ServerºÍ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
Ïà¹ØÎĵµ£º
ORACLE sql µÄ´¦Àí¹ý³Ì´óÖÂÈçÏ£º
1.ÔËÓÃHASHËã·¨£¬µÃµ½Ò»¸öHASHÖµ£¬Õâ¸öÖµ¿ÉÒÔͨ¹ýV$SQLAREA.HASH_VALUE ²é¿´
2.µ½shared pool ÖÐµÄ library cache ÖвéÕÒÊÇ·ñÓÐÏàͬµÄHASHÖµ£¬Èç¹û´æÔÚ£¬ÔòÎÞÐèÓ²½âÎö£¬½øÐÐÈí½âÎö
3.Èç¹ûshared pool²»´æÔÚ´ËHASHÖµ£¬Ôò½øÐÐÓï·¨¼ì²é£¬²é¿´ÊÇ·ñÓÐÓï·¨´íÎó
&nbs ......
ÔÚ΢ÈíµÄSQL ServerϵͳÖÐͨ¹ýÓÐЧµÄʹÓÃË÷Òý¿ÉÒÔÌá¸ßÊý¾Ý¿âµÄ²éѯÐÔÄÜ£¬µ«ÊÇÐÔÄܵÄÌá¸ßÈ¡¾öÓÚÊý¾Ý¿âµÄʵÏÖ¡£ÔÚ±¾ÎÄÖн«»á¸æËßÄãÈçºÎʵÏÖË÷Òý²¢ÓÐЧµÄÌá¸ßÊý¾Ý¿âµÄÐÔÄÜ¡£¡¡
¡¡¡¡
¡¡¡¡ÔÚ¹ØϵÐÍÊý¾Ý¿âÖÐʹÓÃË÷ÒýÄܹ»Ìá¸ßÊý¾Ý¿âÐÔÄÜ£¬ÕâÒ»µãÊǷdz£Ã÷ÏԵġ£ÓõÄË÷ÒýÔ½¶à£¬´ÓÊý¾Ý¿âϵͳÖеõ½Êý¾ÝµÄËٶȾÍÔ½¿ì¡£È»¶ø£¬Ðè ......
±¸·Ý
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR,getdate(),120)
set @strPath='hq'+rtrim(left(replace(@strPath,'-',''),8))
set @strPath = 'D:\sqlback\mydb\' + @strPath + '.bak'
BACKUP DATABASE [mydb] TO DISK = @strPath WITH NOFORMAT, NOINIT, NAME = N'mydb-ÍêÕû Êý¾Ý¿â ±¸·Ý', ......
USE [master]
GO
/****** ¶ÔÏó: StoredProcedure [dbo].[sp_backupdatabase] ½Å±¾ÈÕÆÚ: 07/15/2009 16:23:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[sp_backupdatabase]
@bak_path nvarchar(4000)='', ......
1.´´½¨±í
(1)ÓÃCreate Table ÃüÁî´´½¨±í
Óï·¨:
Create Table tabl_name
({
}column_name As computed_column_expression
}
}[£¬...n]
)
[On {fiegroup | Default}]
[Textimage_On {fiegroup | Default}]
Àý×Ó:
´ò¿ªcustÊý¾Ý¿â£¬´´½¨Ò»¸ö±í£¬¸Ã±í°üº¬ÁËѧÉúµÄÓйØÐÅÏ¢£¬¼´ÓÐѧºÅ¡¢ÐÕÃû¡¢ÐԱ𡢳öÉúÈ ......