Select*fromStudent;+--------+--------+--------+|Name |RollNo|Grade |+ --------+--------+--------+|Gaurav|100 |B.tech||Aarav |150 |M.SC"/> Select*fromStudent;+--------+--------+--------+|Name |RollNo|Grade |+ --------+--------+--------+|Gaurav|100 |B.tech||Aarav |150 |M.SC">
To combine row selection with column selection, we can use the "WHERE" clause. For example, we have the following table -
mysql> Select * from Student; +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Gaurav | 100 | B.tech | | Aarav | 150 | M.SC | | Aryan | 165 | M.tech | +--------+--------+--------+ 3 rows in set (0.00 sec)
Now, the following query will show how to combine row selection with column selection using WHERE clause.
mysql> Select Name, RollNo, Grade from Student where Grade='M.Sc' or Grade='B.Tech'; +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Gaurav | 100 | B.tech | | Aarav | 150 | M.SC | +--------+--------+--------+ 2 rows in set (0.00 sec)
The above is the detailed content of How to combine ROW selection and COLUMN selection in MySQL?. For more information, please follow other related articles on the PHP Chinese website!