21.6 C
New York

MySQL SELECT Statement


Data or records from a database table are being fetched or selected using mysql select query statement as shown in the example below


SELECT CustomerName, City, Country FROM Customers;

How it works

firstly the syntax does the work by identifying the columns each which the user demands to target and from which table the user is requesting the data or records from its column.

the syntax

below is a universal syntax for mysql select statement

 SELECT column1, column2, ...
FROM table_name;

the syntax explained

The query command SELECT initiates the mysli select statement while the column1, column2,.... identifies the columns from the target table the user desires to fetch while the table_name specifies the name of the target database table.

from The example 1 the query specifies specific columns to fetch data from

If you wish to select all the table columns instead use “*” asterisk as in the below code:

 SELECT * FROM Paymentmethod;
Owner and founder of shopinson.com. He is a passionate programmer with enthusiasm in daily discovering of solving logic with new block of codes. He loves creating contents and blogging his new discoveries on programming language and related peripherals.

Related articles


Recent articles