Let's Make Things Better

SQL – Select example

Following are example of SQL SELECT statements:

To select all columns from a table (Customers) for rows where the Last_Name column has Smith for its value, you would send this SELECT statement to the server back end:

SELECT * FROM Customers WHERE Last_Name='Smith';
+---------+-----------+------------+
  | Cust_No | Last_Name | First_Name |
  +---------+-----------+------------+
  | 1001    | Smith     | John       |
  | 2039    | Smith     | David      |
  | 2098    | Smith     | Matthew    |
  +---------+-----------+------------+
  3 rows in set (0.05 sec)

 

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.