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

DB2 SQL´æ´¢¹ý³ÌÓï·¨

 ±³¾°£ºDB2µÄÊý¾Ý¿âÐÔÄܺÜÅ£X£¬µ«ÊÇÆäÎĵµÈ´ºÜ²î£¬ÓÈÆäÊÇ¿ª·¢²Î¿¼Îĵµ£¬¶¼ÊÇÓ¢Îĵģ¬ä¯ÀÀµÄʱºò»¹ºÜ²»ºÃÕÒ£¬ÐèÒªÉÏIBMµÄÍøÕ¾¿´£¬ÍøÕ¾Ò²³öÆæµÄÂý£¬¼«²»·½±ã£¬Èÿª·¢ÈËÔ±¾Ù²½Î¬¼è£¬ÕâÒ²ÐíÊÇIBM DB2µÄÓû§ÉÙ£¬ÊéÉÙ£¬×ÊÁÏÉÙµÄÔ­Òò¡£
£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­
´´½¨SQL´æ´¢¹ý³Ì£¨CREATE PROCEDURE (SQL) statement £©
 
Óï·¨¸ñʽÈçÏ£º
 
>>-CREATE PROCEDURE--procedure-name----------------------------->
>--+----------------------------------------------------+--*---->
   '-(--+------------------------------------------+--)-'
        | .-,------------------------------------. |
        | V .-IN----.                            | |
        '---+-------+--parameter-name--data-type-+-'
            +-OUT---+
            '-INOUT-'
>--+-------------------------+--*------------------------------->
   '-SPECIFIC--specific-name-'
   .-DYNAMIC RESULT SETS 0--------.     .-MODIFIES SQL DATA-.
>--+------------------------------+--*--+-------------------+--->
   '-DYNAMIC RESULT SETS--integer-'     +-CONTAINS SQL------+
                                        '-READS SQL DATA----'
      .-NOT DETERMINISTIC-.     .-CALLED ON NULL INPUT-.
>--*--+-------------------+--*--+----------------------+--*----->
      '-DETERMINISTIC-----'
   .-INHER


Ïà¹ØÎĵµ£º

ORACLE PL/SQL ¼Ç¼(Record)ѧϰ±Ê¼Ç(¶þ)

¶þ¡¢ÒÔÐβεÄÐÎʽ¶¨ÒåºÍʹÓüǼ¡¢¶ÔÏóÀàÐÍ
ÔÚÓÃ×÷ÐÎʽ²ÎÊýʱ£¬¼Ç¼ÀàÐͺͶÔÏóÀàÐÍÓкܶàÏà֮ͬ´¦¡£ÔÚ½«ËüÃÇ×÷ΪÓαꡢº¯Êý»ò¹ý³ÌµÄÐÎʽ²ÎÊýÒÔÇ°£¬ÊÂÏȶ¼±ØÐ붨ÒåÒ»¸ö¼Ç¼ÀàÐÍ»òÕ߶ÔÏóÀàÐÍ¡£
ÈçÏÂÀýËùʾ£º
 
¼Ç¼
DECLARE

-- Define a record type.
TYPE individual_record IS RECORD
(individual_id ......

SQL SERVERÖÐÖ÷¼üºÍÍâ¼ü

 Êý¾Ý¿âÖÐÖ÷¼üºÍÍâ¼ü
(1)×÷ÓÃ
¼òµ¥ÃèÊö£º
 Ö÷¼üÊǶԱíµÄÔ¼Êø£¬±£Ö¤Êý¾ÝµÄΨһÐÔ£¡ 
 Íâ¼üÊǽ¨Á¢±íÓÚ±íÖ®¼äµÄÁªÏµ£¬·½±ã³ÌÐòµÄ±àд£¡
(2)Éè¼ÆÔ­Ôò
Ö÷¼üºÍÍâ¼üÊǰѶà¸ö±í×é֯Ϊһ¸öÓÐЧµÄ¹ØϵÊý¾Ý¿âµÄÕ³ºÏ¼Á¡£Ö÷¼üºÍÍâ¼üµÄÉè¼Æ¶ÔÎïÀíÊý¾Ý¿âµÄÐÔÄܺͿÉÓÃÐÔ¶¼ÓÐמö¶¨ÐÔµÄÓ°Ïì¡£
±ØÐ뽫Êý¾Ý¿âÄ£Ê ......

ÔÚSQL ServerÀï²é¿´µ±Ç°Á¬½ÓµÄÔÚÏßÓû§Êý

 ÔÚSQL ServerÀï²é¿´µ±Ç°Á¬½ÓµÄÔÚÏßÓû§Êý
use master
select loginame,count(0) from sysprocesses
group by loginame
order by count(0) desc
select nt_username,count(0) from sysprocesses
group by nt_username
order by count(0) desc
Èç¹ûij¸öSQL ServerÓû§ÃûtestÁ¬½Ó±È½Ï¶à,²é¿´ËüÀ´×ÔµÄÖ÷»úÃû:
......

SQL ÅжÏÉí·ÝÖ¤ºÅÂë

ÏÖÒªÇó²éѯ½çÃ棺²»ÂÛ15λ»òÕß18λÉí·ÝÖ¤ºÅ¶¼Äܲéѯ³öÊý¾Ý¿âÖÐËùÓе±Ç°Óû§ÐÅÏ¢¡£
·½°¸1£º
create or replace function CONVERT_ID_15 (/*ת»»Éí·ÝÖ¤ºÅΪ15λ*/
  p_id2 in varchar2
) return varchar2
is
  p_id varchar2(20);
  id varchar2(15);
begin
  p_id:=ltrim(p_id2);
  p_id ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ