Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2023-08-23 22:57:02
forward
664 people have browsed it

我们如何从 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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template