ÓÃ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×Ö¶ÎÖÐÊý×Ö²¿·ÖΪ¹Ì¶¨ÖµµÄ¼Ç¼£¬×Öĸ²¿·ÖΪ¶¨ÖµÀàËÆ
Ïà¹ØÎĵµ£º
CREATE Table <±íÃû>
£¨[<ÁÐÃû1>] ÀàÐÍ (³¤¶È) [ȱʡֵ][Áм¶Ô¼Êø]
[£¬<ÁÐÃû2> Êý¾ÝÀàÐÍ[ȱʡֵ][Áм¶Ô¼Êø]]….
[£¬UNIQUE£¨ÁÐÃû[£¬ÁÐÃû]….£©]
[£¬PRIMARY KEY£¨ÁÐÃû[£¬ÁÐÃû]…£©]
&n ......
==============================================
µÚ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 ......
----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¹ÜÀíµÄÒ»¶¨¶ÔÕâЩÃüÁî²»»áÄ°Éú£¬²»¹ý¶ÔÓÚÎÒÕâ¸ö¸Õ½Ó´¥ORACLE¹ÜÀíµÄÀ´Ëµ£¬»¹ÊÇÓбØÒª×öϼǼ£¬ÒÔ±ãËæʱ²é¿´¡£
Ò» µÇ¼SQLPLUS
sqlplus Óû§Ãû/ÃÜÂë@Êý¾Ý¿âʵÀý as µÇ¼½ÇÉ«;
Èç:Óû§sys(ÃÜÂëΪ123)ÒÔsysdbaµÄ½ÇÉ«µÇ¼Êý¾Ý¿âORACL£¬ÎÒÃÇ¿ÉÒÔÊäÈ룺sqlplus sy ......
/********************************
¹¦ÄÜ£º»ñÈ¡±íµÄ¿Õ¼ä·Ö²¼Çé¿ö
**********************************/
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tablespaceinfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
create table tablespaceinfo   ......