Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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·ÖÒ³ ÀûÓÃID´óÓÚ¶àÉÙºÍSELECT TOP·ÖÒ³

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

SQL»ù±¾Óï¾ä

ÕÆÎÕSQLËÄÌõ×î»ù±¾µÄÊý¾Ý²Ù×÷Óï¾ä£ºInsert£¬Select£¬UpdateºÍDelete¡£
¡¡¡¡ Á·ÕÆÎÕSQLÊÇÊý¾Ý¿âÓû§µÄ±¦¹ó²Æ ¸»¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«Òýµ¼ÄãÕÆÎÕËÄÌõ×î»ù±¾µÄÊý¾Ý²Ù×÷Óï¾ä—SQLµÄºËÐŦÄÜ—À´ÒÀ´Î½éÉܱȽϲÙ×÷·û¡¢Ñ¡Ôñ¶ÏÑÔÒÔ¼°ÈýÖµÂß¼­¡£µ±ÄãÍê³ÉÕâЩѧϰºó£¬ÏÔÈ»ÄãÒѾ­¿ªÊ¼ËãÊǾ«Í¨SQLÁË¡£
¡¡¡¡ÔÚÎÒÃÇ¿ªÊ¼Ö®Ç°£¬ÏÈ ......

SQL²éѯÓï¾äʹÓÃ

Ò»¡¢¼òµ¥²éѯ
¡¡¡¡ ¼òµ¥µÄTransact-SQL²éѯֻ°üÀ¨Ñ¡ÔñÁÐ±í¡¢from×Ó¾äºÍWHERE×Ӿ䡣
ËüÃÇ·Ö±ð˵Ã÷Ëù²éѯÁС¢²éѯµÄ
±í»òÊÓͼ¡¢ÒÔ¼°ËÑË÷Ìõ¼þµÈ¡£
ÀýÈ磬ÏÂÃæµÄÓï¾ä²éѯtesttable±íÖÐÐÕÃûΪ“ÕÅÈý”µÄnickname×ֶκÍemail×ֶΡ£
SELECT nickname,email
from testtable WHERE name='ÕÅÈý'
(Ò»)Ñ¡ÔñÁбí
¡ ......

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*PlusʹÓÃÅàѵ (È«8½²)

==============================================
 
µÚ1½²
ÔÚÏß¹Û¿´£º http://www.boobooke.com/v/bbk1389
ÊÓƵÏÂÔØ£º http://www.boobooke.com/v/bbk1389.zip
 
µÚ2½²
ÔÚÏß¹Û¿´£º http://www.boobooke.com/v/bbk1390
ÊÓƵÏÂÔØ£º http://www.boobooke.com/v/bbk1390.zip
 
µÚ3½²
ÔÚÏß¹Û¿´£º http ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ