亚洲av色香蕉一区二区三区,十四以下岁毛片带血a级,亚洲 校园 欧美 国产 另类,亚洲av日韩av一区谷露,色欲av无码一区二区三区

  • 相關軟件
    >END (BEGIN...END) 創(chuàng)建者:webmaster 更新時間:2006-02-16 15:51

    包含一系列 Transact-SQL 語句,這些語句作為一個組同時執(zhí)行。BEGIN...END 語句塊允許嵌套。



    語法


    BEGIN

        { sql_statement | statement_block }

    END



    參數(shù)


    {sql_statement | statement_block}



    是任何有效的 Transact-SQL 語句或以語句塊定義的語句分組。若要定義語句塊(批處理),采用控制流語言關鍵字 BEGIN 和 END。雖然所有的 Transact-SQL 語句在 BEGIN...END 塊內(nèi)都有效,但有些 Transact-SQL 語句不應組合在同一個批處理(語句塊)中。



    結果類型


    Boolean



    示例


    當一本或更多的書滿足這些條件時,這個示例會給出價格低于 $20 的商業(yè)書籍的列表。否則,SQL Server 會給出一條信息,說明沒有書滿足這個條件,并給出價格低于 $20 的所有書的列表。



    SET NOCOUNT OFF
    GO
    USE pubs
    GO
    SET NOCOUNT ON
    GO
    DECLARE @msg varchar(255)
    IF (SELECT COUNT(price)
      FROM titles
      WHERE title_id LIKE 'BU%' AND price < 20) > 0
     
      BEGIN
      SET @msg = 'There are several books that are a good value at under $20. These books are: '
          PRINT @msg
      SET NOCOUNT OFF    
        SELECT title
        FROM titles
        WHERE price < 20
      END
    ELSE
      BEGIN
      SET @msg = 'There are no books under $20. '
          PRINT @msg
      SELECT title
      FROM titles
      WHERE title_id
      LIKE 'BU%'
      AND
      PRICE <10
      END


    下面是結果集:



    There are several books that are a good value at under $20. These books are: 
    title                                                  
    ------------------------------------------------------------------------
    The Busy Executive's Database Guide                              
    Cooking with Computers: Surreptitious Balance Sheets                  
    You Can Combat Computer Stress!                                
    Straight Talk About Computers                                  
    Silicon Valley Gastronomic Treats                                
    The Gourmet Microwave                                        
    Is Anger the Enemy?                                        
    Life Without Fear                                          
    Prolonged Data Deprivation: Four Case Studies                        
    Emotional Security: A New Algorithm                              
    Fifty Years in Buckingham Palace Kitchens                          
    Sushi, Anyone?                                            

    (12 row(s) affected)
    相關文章
    本頁查看次數(shù):