- Learn T-SQL Querying
- Pedro Lopes Pam Lahoud
- 224字
- 2021-06-24 14:38:08
Building blocks of a T-SQL statement
When writing a T-SQL statement, the following three actions are required:
- Express the intended operation, such as reading or changing data
- Provide a target or source list of affected tables
- Provide a condition that filters the affected records
The intended operation is determined by the presence of the following clauses:
- The SELECT clause lists columns or expressions that will be displayed in the result set
- The DELETE, INSERT, or UPDATE clauses state the target table or view for these logical operations
As for the affected tables and filters, they are determined by the following clauses:
- The FROM clause lists the source tables, views and/or sub-queries that contain the data to be queried
- The WHERE clause states one or more conditions that will serve to filter the result set to the desired rows
The preceding clauses determine which data will be manipulated. The formatting of the results can be further modified by adding any of the following parts:
- The ORDER BY clause defines the order in which the rows will be returned
- The GROUP BY clause aggregates rows together based on the criteria provided (typically combined with aggregate functions in the SELECT clause)
- The HAVING clause applies a predicate to the results (different than the WHERE clause, which applies a predicate to the source rows)
推薦閱讀
- Managing Mission:Critical Domains and DNS
- Matplotlib 3.0 Cookbook
- CompTIA Network+ Certification Guide
- 完全掌握AutoCAD 2008中文版:機械篇
- Linux服務與安全管理
- Salesforce for Beginners
- 零起點學西門子S7-200 PLC
- 嵌入式GUI開發設計
- 重估:人工智能與賦能社會
- 數字多媒體技術基礎
- 與人共融機器人的關節力矩測量技術
- 樂高創意機器人教程(中級 上冊 10~16歲) (青少年iCAN+創新創意實踐指導叢書)
- JSP通用范例開發金典
- Appcelerator Titanium Smartphone App Development Cookbook(Second Edition)
- 當產品經理遇到人工智能