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

ÓÃsql»ñȡij×Ö·û´®ÖеÄÊý×Ö²¿·Ö

create function dbo.F_Get_No
(
 @No varchar(100)
)
RETURNS bigint
AS
BEGIN
 WHILE PATINDEX('%[^0-9]%',@No)>0
 BEGIN
  SET @No=STUFF(@No,PATINDEX('%[^0-9]%',@No),1,'') --ɾµôÒ»¸ö·ÇÊý×ÖµÄ×Ö·û£¬Ñ­»·½áÊø£¬Ê£ÓàµÄΪÊý×Ö²¿·Ö
 END
 RETURN CONVERT(bigint,@No)
END
´Ëº¯Êý¿ÉÒÔ·µ»Øij×Ö·û´®ÖеÄÊý×Ö²¿·Ö
PATINDEXº¯Êý ·µ»ØËù²éÄÚÈÝÔÚ×Ö·û´®ÖеÚÒ»´Î³öÏÖµÄË÷Òý
STUFFº¯Êý ɾ³ýÖ¸¶¨³¤¶ÈµÄ×Ö·û²¢ÔÚÖ¸¶¨µÄÆðʼµã²åÈëÁíÒ»×é×Ö·û¡£
select F_Get_No('sdsdf2334sfsd234')  ·µ»Ø'2334234'
×¢Ã÷£º´Ë·½·¨¿ÉÒÔ½â¾ö²éѯij×Ö¶ÎÖÐÊý×Ö²¿·ÖΪ¹Ì¶¨ÖµµÄ¼Ç¼£¬×Öĸ²¿·ÖΪ¶¨ÖµÀàËÆ


Ïà¹ØÎĵµ£º

SQLÓï¾ä´´½¨£¨Êý¾Ý¿â|Êý¾Ý±í|Ë÷Òý£©

CREATE Table <±íÃû>
   £¨[<ÁÐÃû1>] ÀàÐÍ (³¤¶È) [ȱʡֵ][Áм¶Ô¼Êø]
     [£¬<ÁÐÃû2> Êý¾ÝÀàÐÍ[ȱʡֵ][Áм¶Ô¼Êø]]….
     [£¬UNIQUE£¨ÁÐÃû[£¬ÁÐÃû]….£©]
     [£¬PRIMARY KEY£¨ÁÐÃû[£¬ÁÐÃû]…£©]
&n ......

С²¼×÷Æ·£ºOracle 11g SQL»ù´¡ÈëÃÅϵÁÐÅàѵ(È«30½²)

==============================================
 
µÚ01½²: Chapter 00--Oracle 11g SQL Fundamentals Training Introduction
ÔÚÏß¹Û¿´£º http://www.boobooke.com/v/bbk2003
ÊÓƵÏÂÔØ£º http://www.boobooke.com/v/bbk2003.zip
 
µÚ02½²: Chapter 00--Oracle 11g SQL Fundamentals Training Introduction ......

¸ü¶à¼òµ¥¶øʵÓÃµÄ DB2 SQL Óï¾ä


----start
ÎÊÌ⣺²é¿´DB2 °æ±¾---SELECT * from SYSIBM.SYSVERSIONS
ÎÊÌ⣺²é¿´ÏµÍ³ÖÐÓÐÄÄЩ±íÒÔ¼°ÕâЩ±íµÄ¸ÅÒªÐÅÏ¢£ºSELECT * from SYSCAT.TABLES
ÎÊÌ⣺²é¿´Ä³¸ö±íÓÐÄÄЩÁÐÒÔ¼°ÕâЩÁеĸÅÒªÐÅÏ¢£ºSELECT * from SYSCAT.COLUMNS WHERE  TABNAME=<YOUR_TABLE_NAME>
---´ýÐøδÍê
---¸ü¶à²Î¼û£ºDB2 SQL ¾«Ò ......

³£ÓõÄORACLE PL/SQL¹ÜÀíÃüÁîÒ»

Ô­ÎÄ£ºÁõÎä| ³£ÓõÄORACLE PL/SQL¹ÜÀíÃüÁîÒ»
ÊìϤORACLE¹ÜÀíµÄÒ»¶¨¶ÔÕâЩÃüÁî²»»áÄ°Éú£¬²»¹ý¶ÔÓÚÎÒÕâ¸ö¸Õ½Ó´¥ORACLE¹ÜÀíµÄÀ´Ëµ£¬»¹ÊÇÓбØÒª×öϼǼ£¬ÒÔ±ãËæʱ²é¿´¡£
Ò» µÇ¼SQLPLUS
sqlplus Óû§Ãû/ÃÜÂë@Êý¾Ý¿âʵÀý as µÇ¼½ÇÉ«;
Èç:Óû§sys(ÃÜÂëΪ123)ÒÔsysdbaµÄ½ÇÉ«µÇ¼Êý¾Ý¿âORACL£¬ÎÒÃÇ¿ÉÒÔÊäÈ룺sqlplus sy ......

SQL SERVER»ñÈ¡±íµÄ¿Õ¼ä·Ö²¼Çé¿ö

/********************************
¹¦ÄÜ£º»ñÈ¡±íµÄ¿Õ¼ä·Ö²¼Çé¿ö
**********************************/
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tablespaceinfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
create table  tablespaceinfo      ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ