How to select data from a single table

The simplified syntax of the SELECT statement

      SELECT select_list FROM table_source [WHERE search_condition] [ORDER BY order_by_list];
      

Retrieve all rows and columns from a table

      SELECT * FROM products;
      
select image
      (3 rows of 10)
      

Retrieve three columns and sort them by price

       SELECT productID, productName, listPrice 
       FROM products 
       ORDER BY listPrice;
      
select order by image
      (6 rows of 10)
      

Retrieve rows in the specified price range

      SELECT productID, productName, listPrice 
      FROM products 
      WHERE listPrice < 450
      ORDER BY listPrice;
      
select where image
      (6 rows of 10)
      

Retrieve an empty result set

      SELECT productID, productName, listPrice 
      FROM products 
      WHERE listPrice < 10;
      

Back