SQL SELECT Statement

Chapter: SQL Commands Last Updated: 16-03-2018 08:33:56 UTC

Program:

            /* ............... START ............... */
                
SELECT column1, column2, ...
FROM table_name;

SELECT * FROM Table_Name  /* Select all columns from Table */

SELECT TOP 10 FROM Table_Name /* Select top 10 Result */

                /* ............... END ............... */
        

Notes:

  • The SELECT statement is used to select data from a database. We will call the set of result as SQL result-set.
  • In the first selection statement of the query user can specify the columns to select from the table. This selection statement is used when we need to select the columns in particular order or want to select only some particular columns of table.
  • SELECT * FROM Table_Name - This will give all the columns in the table in particular order in which table designed. Normally when we query the table developers mostly use the this type of selection query.
  • SELECT TOP 10 FROM Table_Name - This query will give the result of 10 rows in the result-set. After top we can specify the number of rows needs to select from the table. This top select statement is mostly used to limit the number of rows selection.

Tags

SQL, SELECT Statement, SELECT Syntax

Similar Programs Chapter Last Updated
SQL Query To List All Databases SQL Commands 17-04-2023
SQL Query To Find Duplicate Records SQL Commands 17-04-2023
How To Create Procedure In SQL SQL Commands 24-03-2023
Group By In SQL SQL Commands 12-11-2020
Substring In SQL SQL Commands 27-11-2019

1