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

ORACLEºÍSQLÓï·¨Çø±ð¹éÄÉ

¹Ø¼ü×Ö: oracle & sql server
Êý¾ÝÀàÐͱȽÏ
ÀàÐÍÃû³Æ
Oracle
SQLServer
±È½Ï
×Ö·ûÊý¾ÝÀàÐÍ CHAR CHAR ¶¼Êǹ̶¨³¤¶È×Ö·û×ÊÁϵ«oracleÀïÃæ×î´ó¶ÈΪ2kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
±ä³¤×Ö·ûÊý¾ÝÀàÐÍ VARCHAR2 VARCHAR OracleÀïÃæ×î´ó³¤¶ÈΪ4kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¹Ì¶¨³¤¶È×Ö·û´® NCHAR NCHAR Ç°Õß×î´ó³¤¶È2kbºóÕß×î´ó³¤¶È4kb
¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¿É±ä³¤¶È×Ö·û´® NVARCHAR2 NVARCHAR ¶þÕß×î´ó³¤¶È¶¼Îª4kb
ÈÕÆÚºÍʱ¼äÊý¾ÝÀàÐÍ DATE ÓÐDatetimeºÍSmalldatetimeÁ½ÖÖ ÔÚoracleÀïÃæ¸ñʽΪDMYÔÚSQLSerserÀïÃæ¿ÉÒÔµ÷½Ú£¬Ä¬ÈϵÄΪMDY
Êý×ÖÀàÐÍ NUMBER(P,S) NUMERIC[P(,S)] OracleÀïÃæp´ú±íСÊýµã×óÃæµÄλÊý£¬s´ú±íСÊýµãÓÒÃæµÄλÊý¡£¶øSQLServerÀïÃæp´ú±íСÊýµã×óÓÒÁ½ÃæµÄλÊýÖ®ºÍ£¬s´ú±íСÊýµãÓÒÃæµÄλÊý¡£
Êý×ÖÀàÐÍ DECIMAL(P,S) DECIMAL[P(,S)] OracleÀïÃæp´ú±íСÊýµã×óÃæµÄλÊý£¬s´ú±íСÊýµãÓÒÃæµÄλÊý¡£¶øSQLServerÀïÃæp´ú±íСÊýµã×óÓÒÁ½ÃæµÄλÊýÖ®ºÍ£¬s´ú±íСÊýµãÓÒÃæµÄλÊý¡£
ÕûÊýÀàÐÍ INTEGER INT ͬΪÕûÊýÀàÐÍ£¬´æ´¢´óС¶¼Îª4¸ö×Ö½Ú
¸¡µãÊýÀàÐÍ FLOAT FLOAT
ʵÊýÀàÐÍ REAL REAL
ORACLEÄÚ²¿º¯Êý´óÈ«ÒÔ¼°ÓëSQLSERVERµÄÇø±ð£º
ÏÂÃæÊÇOracleÖ§³ÖµÄ×Ö·ûº¯ÊýºÍËüÃǵÄMicrosoft SQL ServerµÈ¼Ûº¯Êý¡£
º¯Êý Oracle Microsoft SQL¡¡Server
°Ñ×Ö·ûת»»ÎªASCII :ASCII ASCII
×Ö´®Á¬½Ó: CONCAT --------------(expression + expression)
°ÑASCIIת»»Îª×Ö·û CHR, CHAR
·µ»Ø×Ö·û´®ÖеĿªÊ¼×Ö·û£¨×óÆ𣩠INSTR ,---------------CHARINDEX
°Ñ×Ö·ûת»»ÎªÐ¡Ð´ LOWER ---------------------LOWER
°Ñ×Ö·ûת»»Îª´óд UPPER-------------------- UPPER
Ìî³ä×Ö·û´®µÄ×ó±ß LPAD --------------------N/A
Çå³ý¿ªÊ¼µÄ¿Õ°× LTRIM--------------------LTRIM
Çå³ýβ²¿µÄ¿Õ°× RTRIM --------------------RTRIM
×Ö·û´®ÖеÄÆðʼģʽ£¨pattern£© INSTR --------------------PATINDEX
¶à´ÎÖظ´×Ö·û´® RPAD --------------------REPLICATE
×Ö·û´®µÄÓïÒô±íʾ SOUNDEX --------------------SOUNDEX
Öظ´¿Õ¸ñµÄ×Ö´® RPAD --------------------SPACE
´ÓÊý×ÖÊý¾Ýת»»Îª×Ö·ûÊý¾Ý TO_CHAR --------------------STR
×Ó´® SUBSTR --------------------SUBSTRING
Ìæ»»×Ö·û REPLACE --------------------STUFF
½«×Ö´®ÖеÄÿ¸ö´ÊÊ××Öĸ´óд INITCAP --------------------N/A
·­Òë×Ö·û´® TRANSLATE


Ïà¹ØÎĵµ£º

sql²éѯ±í½á¹¹£¬¹ý³Ì£¬ÊÓͼ£¬Ö÷¼ü£¬Íâ¼ü£¬Ô¼Êø

 Ò»¡¢±í½á¹¹²éѯ
SELECT TOP (100) PERCENT a.name AS zdm,COLUMNPROPERTY(a.id, a.name, 'IsIdentity') AS bs ,
CASE WHEN EXISTS (SELECT 1 from dbo.sysindexes si INNER JOIN dbo.sysindexkeys sik ON si.id = sik.id
 AND si.indid = sik.indid INNER JOIN dbo.syscolumns sc ON sc.id = sik.id AND sc. ......

SQL·ÖÒ³ ÀûÓÃID´óÓÚ¶àÉÙºÍSELECT TOP·ÖÒ³

Óï¾äÐÎʽ£º¡¡ SELECTTOP10*
fromTestTable
WHERE(ID>
¡¡¡¡¡¡¡¡¡¡(SELECTMAX(id)
¡¡¡¡¡¡¡¡from(SELECTTOP20id
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡fromTestTable
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ORDERBYid)AST))
ORDERBYID
SELECTTOPÒ³´óС*
fromTestTable
WHERE(ID>
¡¡¡¡¡¡¡¡¡¡(SELECTMAX(id)
¡¡¡¡¡¡¡¡from(SELECTTOPÒ³´óС*Ò³Êýid
¡¡¡¡¡ ......

C#µ÷ÓÃSQL´æ´¢¹ý³ÌÒÔ¼°·µ»ØÖµºÍ²ÎÊýµÄ»ñÈ¡

QZone Editor
.dump{}

//TODO ÓòÃû
if (location.hash) {
document.domain=location.hash.substr(1);
}

//parent.qZEditor.callback();
function init(){
//»ñÈ¡±à¼­Æ÷Ãæ°åID
var pid = frameElement.panelID;

//»ñÈ¡±à¼­Æ÷Ãæ°å¶ÔÏó ......

SQLÖг£Óú¯ÊýµÄÕûÀí

¶ÔÓÚsqlÖеĺ¯Êý¿ÉνÊǶàµÄ²»Ê¤Ã¶¾Ù£¬±¾ÎÄ´Ó³£Óú¯ÊýµÄ½Ç¶È¶ÔÆ亯Êý½øÐÐ×ܽ᣺1¡¢ÈÕÆÚºÍʱ¼äº¯Êý2¡¢×Ö·û´®º¯Êý3¡¢ÏµÍ³º¯ÊýÁ÷³Ì¿ØÖÆÓï¾ä
1¡¢  ÈÕÆÚºÍʱ¼äº¯Êý
¶ÔÓÚÈÕÆÚº¯ÊýÎÒÃÇ¿ÉÒÔ·ÖΪ2СÀà½øÐзÖÎö´¦Àí£¬
A¡¢ ÈÕÆÚµÄÕûÌå´¦Àíº¯Êý£¬¾ßÌåµÄº¬ÒåºÍÓï·¨ÈçÏÂËùʾ£º
DATEADD(datepart,number,date)
µÚÒ»¸ö²ÎÊý˵Ã÷ÒªÌí ......

ORACLE³£ÓÃSQL

Ò».ORACLE³£Óñí
1.dual     ORACLEÓÃÀ´¸øûÓбíµÄÔËËã·û.Èç:select sysdate from dual;
¶þ.×Ö·û´®²Ù×÷
1.||  ×Ö·û´®¼Ó·¨  select 'a'||'bc' from dual;      --'abc'
Èý.ʱ¼äºÍÈÕÆÚ
1.sysdate     ϵͳµ±Ç°µÄÈÕÆÚ
   &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ