
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can we combine ROW selection with COLUMN selection in MySQL?
For combining ROW selection with COLUMN selection, we can use the ‘WHERE’ clause. For example, we have a table below −
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 we can 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)
- Related Articles
- Can we set JOptionPane with predefined selection in Java?
- How to enable row selection in a JTable with Java
- How can we combine functions in MySQL?
- Java Program to enable column selection in a JTable
- Selection Sort
- Directional Selection
- Can we combine MySQL IN AND LIKE operators?
- How can we create MySQL views with column list?
- Selection sort in Java.
- How to combine few row records in MySQL?
- Activity Selection Problem
- MySQL query to perform selection using AND OR
- How out-gridview selection works in PowerShell?
- Can we use backticks with column value in MySQL?
- Selection Sort program in C#

Advertisements