Select table | SQL Tutorial and Query Example

Text copied!

Select table


  • The syntax of the SELECT table statement generally looks like this :
    Here's an example of how to select all columns and rows from a table :

    1. Run below SQL statement that selects all columns and rows from the [Product] table :

    SELECT *
    FROM table_name;
    Here's an example of how to select specific columns from a table :

    1. Run below SQL statement that selects specific columns from the [Product] table :

    Here's an example of how to select specific number of rows from a table :

    1. Run below SQL statement :

    SELECT *
    FROM [Product];
            
    Select table
    SELECT [ProductID], [Name], [ProductNumber]
    FROM [Product];
            
    Select table
    SELECT TOP 3 *
    FROM [Product];
            
    Select table

    Frequently Asked Questions :

    To SELECT a table in SQL, you use the "SELECT" statement followed by the columns you want to retrieve from the table.
    To SELECT a table list in SQL, you query the system catalogs or information_schema views to retrieve the list of tables.
    "SELECT *" in SQL selects all columns from a table.
    A SELECT query in SQL retrieves data from a database table based on specified criteria using the "SELECT" statement.