WHERE 子句搜尋條件在進行分組操作之前應用;而 HAVING 搜尋條件在進行分組操作之後應用。HAVING 文法與 WHERE 文法類似,但 HAVING 可以包含彙總函式。HAVING 子句可以引用挑選清單中出現的任意項。 理解應用 WHERE、GROUP BY 和 HAVING 子句的正確序列對編寫高效的查詢代碼會有所協助: WHERE 子句用來篩選 FROM 子句中指定的操作所產生的行。GROUP BY 子句用來分組 WHERE 子句的輸出。HAVING 子句用來從分組的結果中篩選行。
對於有巨大的結果集的查詢(上萬條記錄或更多),首先查詢資料到結果表格,隨後把資料匯出到檔案裡,這樣做也許是不方便的。這也許會花很長時間和佔用很多記憶體資源。這樣還不如直接寫結果集到匯出檔案裡更有效。要做到這一點,你可以按 SQL 編輯器右邊的匯出查詢結果…按鈕,以取代工具列裡的執行按鈕。這將顯示出一個彈出式菜單,在這裡你可以選擇匯出資料到 CSV 格式(逗號分隔值)、 TSV 格式(制表符分隔值)、 HTML 格式或 XML
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CheckAndRatify_Stat]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[CheckAndRatify_Stat]GOSET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GOCREATE PROCEDURE
What's the difference between an event and a delegate? Put simply, an event gives more limited access than a delegate. If an event is made public, code in other classes can only add or remove handlers for that event; they can't necessarily fire it,
When should I use == and when should I use Equals? The Equals method is just a virtual one defined in System.Object, and overridden by whichever classes choose to do so. The == operator is an operator which can be overloaded by classes, but which
Speed of direct calls vs interfaces vs delegates vs virtuals Consider the following code:interface IProcessor{ void Process();}class Processor: IProcessor{ public void Process() { }}If I write something like:Processor p = new Processor();