MySQL Select Query with Where Clause:
(1) In the previous blog we learn about MySQL Insert Query to insert data into the database table. Now in this blog, we learn about how to read data from a database table.
(2) If you want to select some columns in a database, then use the below syntax.
SELECT column1, column2, ………. FROM table_name; |
(3) Now open the MySQL Workbench and log in to it. Now go to the table and write the “select” query to get particular columns as shown.

(4) You can also change the column id in the display by using the following query as shown below.

(5) If you want to select all columns in a database, then use the below syntax.
SELECT * FROM table_name; |

(6) Now we use the WHERE clause with the SELECT statement or query. The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified condition. The syntax is given below.
SELECT column1, column2, ………. FROM table_name WHERE condition |
(7) Some basic conditions which we use with the WHERE clause are given below.
= | Equal |
!= | Not Equal |
> | Greater Than |
< | Lesser Than |
>= | Greater than or Equal to |
<= | Lesser than or Equal to |
- Use Equal Condition:

- Use Greater Than Condition:

- Use Lesser Than Condition:

- Use Greater than or Equal to Condition:

- Use Not Equal Condition:

Programming Languages Computer Input Devices Secondary Storage Devices World Wide Web (WWW) Application Software Operating System as a Resource Manager MySQL– Wikipedia |
Comments (No)