Select statement - Part 10


The SELECT statement is used to select data from a Table. The data returned is stored in a result table, called the result-set.
 
Basic select statement syntax
SELECT Column_List
FROM Table_Name

If you want to select all the columns, you can also use *. For better performance use the column list, instead of using *.
SELECT *
FROM Table_Name

Filtering rows with WHERE clause
SELECT Column_List
FROM Table_Name
WHERE Filter_Condition


The SELECT TOP clause is used to specify the number of records to return.
 SELECT top(1) *
FROM Table_Name

No comments :

Post a Comment