Home  >  Article  >  Database  >  How can we get specific rows as output from MySQL table?

How can we get specific rows as output from MySQL table?

WBOY
WBOYforward
2023-08-23 22:57:02637browse

我们如何从 MySQL 表中获取特定行作为输出?

For getting specific rows as output, we need to use WHERE clause in SELECT statement. This is because MySQL returns rows based on the conditional parameters we give after the WHERE clause.

Example

Suppose we want to get rows containing the name 'Aarav' from the student table, we can use the following query to achieve this:

mysql> Select * from Student WHERE Name = 'Aarav';
+------+-------+---------+---------+
| Id   | Name  | Address | Subject |
+------+-------+---------+---------+
| 2    | Aarav | Mumbai  | History |
+------+-------+---------+---------+
1 row in set (0.00 sec)

The above is the detailed content of How can we get specific rows as output from MySQL table?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete