Bottom Article Ad

Ads Here

Monday, September 23, 2019

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.
  •   FROM
  •   ON
  •   JOIN
  •   WHERE
  •   GROUP BY
  •   WITH CUBE or WITH ROLLUP
  •   HAVING
  •   SELECT
  •   DISTINCT
  •   ORDER BY
  •   TOP







No comments:

Post a Comment