- 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)
推薦閱讀
- Oracle SOA Governance 11g Implementation
- Getting Started with Containerization
- 數據庫原理與應用技術學習指導
- 數據運營之路:掘金數據化時代
- 人工智能工程化:應用落地與中臺構建
- 最后一個人類
- Photoshop CS3圖像處理融會貫通
- WordPress Theme Development Beginner's Guide(Third Edition)
- 網絡管理工具實用詳解
- 典型Hadoop云計算
- 貫通Hibernate開發
- Cloudera Hadoop大數據平臺實戰指南
- Serverless Design Patterns and Best Practices
- PowerPoint 2010幻燈片制作高手速成
- 開放自動化系統應用與實戰:基于標準建模語言IEC 61499