SQL SELECT Statement

SQL SELECT Statement:-                                           

                                                   Retrieves rows from the database and we can select one or many rows or columns from one or many tables in SQL Server. The syntax of the SELECT statement is:-
                    
             SELECT column1, column2, ...
              FROM table_name;

Here column1, column2 are the column names of  the table. 

Syntax to find all columns of the table:-
                               
                               SELECT * FROM table_name;

Example of selecting columns with specific column names from the table:-

SQL SELECT Statement


Example of select all data from table is as:-

SQL SELECT Statement

Logical Processing Order of the SELECT statement:

The execution of the statement is determined by the query processor and the order may vary from this list.
  1.   FROM
  2.   ON
  3.   JOIN
  4.   WHERE
  5.   GROUP BY
  6.   WITH CUBE or WITH ROLLUP
  7.   HAVING
  8.   SELECT
  9.   DISTINCT
  10.   ORDER BY
  11.   TOP







Post a Comment

0 Comments