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

Mysql£¬SqlServer£¬OracleÖ÷¼ü×Ô¶¯Ôö³¤µÄÉèÖÃ


Mysql£¬SqlServer£¬OracleÖ÷¼ü×Ô¶¯Ôö³¤µÄÉèÖÃ
1¡¢°ÑÖ÷¼ü¶¨ÒåΪ×Ô¶¯Ôö³¤±êʶ·ûÀàÐÍ
ÔÚmysqlÖУ¬Èç¹û°Ñ±íµÄÖ÷¼üÉèΪauto_incrementÀàÐÍ£¬Êý¾Ý¿â¾Í»á×Ô¶¯ÎªÖ÷¼ü¸³Öµ¡£ÀýÈ磺
create table customers(id int auto_increment primary key not null, name varchar(15));
insert into customers(name) values("name1"),("name2");
select id from customers;
ÒÔÉÏsqlÓï¾äÏÈ´´½¨ÁËcustomers±í£¬È»ºó²åÈëÁ½Ìõ¼Ç¼£¬ÔÚ²åÈëʱ½ö½öÉ趨ÁËname×ֶεÄÖµ¡£×îºó²éѯ±íÖÐid×ֶΣ¬²éѯ½á¹ûΪ£º
id
1
2
Óɴ˿ɼû£¬Ò»µ©°ÑidÉèΪauto_incrementÀàÐÍ£¬mysqlÊý¾Ý¿â»á×Ô¶¯°´µÝÔöµÄ·½Ê½ÎªÖ÷¼ü¸³Öµ¡£
ÔÚMS SQLServerÖУ¬Èç¹û°Ñ±íµÄÖ÷¼üÉèΪidentityÀàÐÍ£¬Êý¾Ý¿â¾Í»á×Ô¶¯ÎªÖ÷¼ü¸³Öµ¡£ÀýÈ磺
create table customers(id int identity(1,1) primary key not null, name varchar(15));
insert into customers(name) values("name1"),("name2");
select id from customers;
²éѯ½á¹ûºÍmysqlµÄÒ»Ñù¡£Óɴ˿ɼû£¬Ò»µ©°ÑidÉèΪidentityÀàÐÍ£¬MS SQLServerÊý¾Ý¿â»á×Ô¶¯°´µÝÔöµÄ·½Ê½ÎªÖ÷¼ü¸³Öµ¡£identity°üº¬Á½¸ö²ÎÊý£¬µÚÒ»¸ö²ÎÊý±íʾÆðʼֵ£¬µÚ¶þ¸ö²ÎÊý±íʾÔöÁ¿¡£
2¡¢´ÓÐòÁÐÖлñÈ¡×Ô¶¯Ôö³¤µÄ±êʶ·û
ÔÚOracleÖУ¬¿ÉÒÔΪÿÕűíµÄÖ÷¼ü´´½¨Ò»¸öµ¥¶ÀµÄÐòÁУ¬È»ºó´ÓÕâ¸öÐòÁÐÖлñÈ¡×Ô¶¯Ôö¼ÓµÄ±êʶ·û£¬°ÑËü¸³Öµ¸øÖ÷¼ü¡£ÀýÈçÒ»ÏÂÓï¾ä´´½¨ÁËÒ»¸öÃûΪcustomer_id_seqµÄÐòÁУ¬Õâ¸öÐòÁÐµÄÆðʼֵΪ1£¬ÔöÁ¿Îª2¡£
create sequence customer_id_seq increment by 2 start with 1
Ò»µ©¶¨ÒåÁËcustomer_id_seqÐòÁУ¬¾Í¿ÉÒÔ·ÃÎÊÐòÁеÄcurvalºÍnextvalÊôÐÔ¡£
curval£º·µ»ØÐòÁеĵ±Ç°Öµ
nextval£ºÏÈÔö¼ÓÐòÁеÄÖµ£¬È»ºó·µ»ØÐòÁÐÖµ
ÒÔÏÂsqlÓï¾äÏÈ´´½¨ÁËcustomers±í£¬È»ºó²åÈëÁ½Ìõ¼Ç¼£¬ÔÚ²åÈëʱÉ趨ÁËidºÍname×ֶεÄÖµ£¬ÆäÖÐid×ֶεÄÖµÀ´×ÔÓÚcustomer_id_seqÐòÁС£×îºó²éѯcustomers±íÖеÄid×ֶΡ£
create table customers(id int primary key not null, name varchar(15));
insert into customers values(customer_id_seq.curval, "name1"),(customer_id_seq.nextval, "name2");
select id from customers;
Èç¹ûÔÚoracleÖÐÖ´ÐÐÒÔÉÏÓï¾ä£¬²éѯ½á¹ûΪ£º
id
1
3
http://blog.csdn.net/andyelvis/archive/2008/05/14/2446865.aspx


Ïà¹ØÎĵµ£º

Oracleµ¼Èë/µ¼³öÊý¾Ý

Oracle ÌṩÁ½¸ö¹¤¾ßimp.exe ºÍexp.exe·Ö±ðÓÃÓÚµ¼ÈëºÍµ¼³öÊý¾Ý¡£ÕâÁ½¸ö¹¤¾ßλÓÚOracle_home/binĿ¼Ï¡£
µ¼³öÊý¾Ýexp
1 ½«Êý¾Ý¿âATSTestDBÍêÈ«µ¼³ö,Óû§Ãûsystem ÃÜÂë123456 µ¼³öµ½c:\export.dmpÖÐ
exp system/123456@ATSTestDB file=c:\export.dmp full=y
ÆäÖÐATSTestDBΪÊý¾Ý¿âÃû³Æ£¬sys ......

¹ØÓÚoracleµÄһЩÔÓÆßÔӰ˵IJÙ×÷

1¡¢¸ü¸Ä±íÃû/ÁÐÃû
Ê×ÏÈ£¬ÒªÒÔsysdbaÉí·ÝµÇ¼£¬²ÅÄܶԱíÃû/ÁÐÃû½øÐиü¸Ä£º
(1)µÇ½sqlplus£¬¿ÉÒÔÒÔnolog·½Ê½µÇ½£¬¹ØÓÚÕâÖֵǽ·½·¨£¬¿ÉÔÚsqlplusµÄͼ±êÉÏÓÒ¼ü£¬µã»÷ÊôÐÔ£¬ÔÚ"Ä¿±ê"À¸¸ÄΪ£º"D:\oracle\product\10.2.0\client_1\BIN\sqlplusw.exe /nolog"£¬È»ºóÔÙË«»÷sqlplusͼ±ê¾Í¿É½øÈë¡£
ÓÐʱoracle²¢²»ÔÚ±¾µØµçÄÔÉÏ£¬µ ......

»ùÓÚOCCI·ÃÎÊOracleµÄ¼Ç¼

ÎÒÔÚoracle 9iµÄ»·¾³Ï¿ª·¢ÁËocciµÄÓ¦Ó㬽á¹û·Åµ½10g(10.2.0.3)·þÎñÆ÷ÉÏÔËÐв»ÁË(Ö»×°ÁËwindows °æµÄ10g·þÎñ¶Ë)£¬Ö»ºÃ°ÑËùÓÐÒÀÀµµÄ9iµÄdll¿½¹ýÈ¥£¬½á¹ûÁ¬½Óocci±¨´í£º
Error while trying to retrieve text for error ORA-32101
µ½http://www.oracle.com/technology/global/cn/software/tech/oci/instantclient/index.ht ......

SQL ServerÀïµÄ ISNULL Óë Oracle ÖÐµÄ NULLIF

SQL ServerÀïµÄ ISNULL Óë Oracle ÖÐµÄ NULLIF²»Í¬:
  SQL Server ÖÐÓÐÁ½¸ö²ÎÊý£¬Óï·¨£º
    ISNULL(check_expression, replacement_value)
    check_expression Óë replacement_value Êý¾ÝÀàÐͱØÐëÒ»ÖÂ
   
Èç¹û check_expression Ϊ NULL£¬Ôò·µ»Ø replacement_v ......

ÐÞ¸ÄmysqlµÄrootÃÜÂëµÄ¼¸ÖÖ·½·¨

×÷Õß: Ф½¨±ò
| ¿ÉÒÔ×ªÔØ, ×ªÔØÊ±Îñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂԭʼ³ö´¦
ºÍ×÷ÕßÐÅÏ¢¼°°æÈ¨ÉùÃ÷
꿅᣼http://www.xiaojb.com/archives/it/mysqlroot.shtml
Method 1:
ÔÚ/usr/local/mysql/bin/Ï£º
./mysqladmin -u root password ‘new_password’
Ò»°ã°²×°Ê±Óô˷½·¨ÉèÖá£
Method 2:
ÔÚmysql×´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ