- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Fetch records containing a specific character twice in MySQL
Let us first create a table −
mysql> create table DemoTable -> ( -> Words text -> ); Query OK, 0 rows affected (0.54 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('Ever'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values('Forever'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Good'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('Never'); Query OK, 1 row affected (0.12 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
+---------+ | Words | +---------+ | Ever | | Forever | | Good | | Never | +---------+ 4 rows in set (0.00 sec)
Following is the query to fetch records containing a specific character twice. Here, we are searching for records with the character “e” appearing 2 times −
mysql> select *from DemoTable where Words LIKE '%e%e%';
+---------+ | Words | +---------+ | Ever | | Forever | | Never | +---------+ 3 rows in set (0.00 sec)
- Fetch ordered records after a specific limit in MySQL
- Select * but ignore displaying results containing a specific character in MySQL
- MySQL to fetch records based on a specific month and year?
- How can fetch records from specific month and year in a MySQL table?
- MySQL RegExp to fetch records with only a specific number of words
- MySQL REGEXP to fetch string + number records beginning with specific numbers?
- How to use MySQL SELECT LEFT to fetch the records containing string with slash
- UNIX_TIMESTAMP with date in MySQL query to fetch records after a specific date in different format?
- MySQL query to fetch specific records matched from an array (comma separated values)
- Fetch a specific column value (name) in MySQL
- MySQL db query to fetch records from comma separate values on the basis of a specific value
- MySQL query to find a match and fetch records
- Fetch similar ID records from two tables in MySQL
- Fetch records from comma separated values using MySQL IN()?
- Fetch the count of a specific date in a MySQL table