
- 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
Perform case insensitive SELECT using MySQL IN()?
Let us first create a table −
mysql> create table DemoTable1460 -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.91 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1460 values('Chris'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable1460 values('David'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable1460 values('Bob'); Query OK, 1 row affected (0.52 sec) mysql> insert into DemoTable1460 values('Robert'); Query OK, 1 row affected (0.11 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1460;
This will produce the following output −
+--------+ | Name | +--------+ | Chris | | David | | Bob | | Robert | +--------+ 4 rows in set (0.00 sec)
Following is the query to implement case insensitive SELECT using “IN” −
mysql> select * from DemoTable1460 where UPPER(Name) IN('CHRIS','BOB');
This will produce the following output −
+-------+ | Name | +-------+ | Chris | | Bob | +-------+ 2 rows in set (0.00 sec)
- Related Articles
- How to perform case-insensitive search in Oracle?
- MySQL case-insensitive DISTINCT?
- How to perform Case Insensitive matching with JavaScript RegExp?
- How to perform SELECT using COUNT in MySQL?
- How to achieve case sensitive uniqueness and case insensitive search in MySQL?
- Case-insensitive string replacement using Python Program
- Case insensitive search in Mongo?
- Case-insensitive Dictionary in C#
- Is Python case-sensitive or case-insensitive?
- Case-insensitive string comparison in C++
- How to use case-insensitive switch-case in JavaScript?
- JavaScript Count characters case insensitive
- Perform count with CASE WHEN statement in MySQL?
- Implement case sensitivity in MySQL SELECT statements
- Change value from 1 to Y in MySQL Select Statement using CASE?

Advertisements