In this article we will see "How to SELECT data FROM a Table in MySql" and "MySql SELECT query syntax with example".

"SELECT" query syntax

"SELECT" is used to SELECT data FROM a Table in MySql, the syntax is as follow.


SELECT * FROM tableName;

"SELECT" query example

"SELECT" is used to SELECT data FROM a Table in MySql, as shown in the example below.


/* Use database where the table is going to be SELECT FROMd*/
use testDatabase;

/* SELECT data */
SELECT * from testTable;

Output: Output will be something like this:


+------+--------------------+-----------+
| id   | email              | name      |
+------+--------------------+-----------+
|    1 | info@techburps.com | techburps |
|    2 | NULL               | techburps |
+------+--------------------+-----------+
2 rows in set (0.00 sec)


"SELECT" for specified columns query syntax

"SELECT" can be used to SELECT data for specified columns of a Table in MySql, the syntax is as follow.


SELECT column1, column2, ...
FROM tableName;

"SELECT" for specified columns query example

"SELECT" can be used to SELECT data for specified columns of a Table in MySql, as shown in the example below.


/* Use database where the table is going to be SELECT FROMd*/
use testDatabase;

/* SELECT data */
SELECT id,email from testTable;

Output: Output will be something like this:


+------+--------------------+
| id   | email              |
+------+--------------------+
|    1 | info@techburps.com |
|    2 | NULL               |
+------+--------------------+
2 rows in set (0.00 sec)


In this article we have seen "How to SELECT data FROM a Table in MySql", in upcoming articles we will see more about Mysql syntax and queries with example.
  • By Techburps.com
  • Oct 17, 2017
  • MySql