Fetch a Particular Row from a MySQL Table



For fetching a particular row as output, we need to use WHERE clause in the SELECT statement. It is because MySQL returns the row based on the condition parameter given by us after WHERE clause.

Example

Suppose we want to fetch a row which contains the name ‘Aarav’ from student table then it can be done with the help of the following query −

mysql> Select * from Student WHERE Name = 'Aarav';
+------+-------+---------+---------+
| Id   | Name  | Address | Subject |
+------+-------+---------+---------+
| 2    | Aarav | Mumbai  | History |
+------+-------+---------+---------+
1 row in set (0.00 sec)
Updated on: 2020-06-20T06:20:28+05:30

4K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements