T-SQL query statements

Source: Internet
Author: User
在对数据进行管理时,除了使用SSMS之外,还可以使用T-SQL语言进行数据的管理和维护。接下来,为大家介绍T-SQL语法的语法结构与使用。

First, T-SQL
1, T-SQL composition
DML: Used to query, insert, delete, and modify data in a database
DDL: Used to build a database and define its columns
DCL: Used to control access permissions for database components
Second, query data using T-SQL
1. T-SQL syntax structure
SELECT < column names > from < table names > WHERE < query constraints >
(1) Querying all columns in a table
SELECT from table_name ( representing all columns)
For example: Query Student table Secondary School information
SELECT * FROM table_name
(2) Querying a specific column in a table
SELECT column_name__1,column_name_2,....... From table_name
For example: Query the class and grade of the name in the student table
SELECT name, class, score from student
(3) Querying a specific row in a table-conditional query
SELECT select_list from table_name WHERE search_conditions
(4) The number of rows that the query returns limits
SELECT TOP n select_list from table_name

        T-SQL 中的查询基本格式是有SELECT子句、FROM子句、和WHERE 子句组成的查询块。

T-SQL query statements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.