- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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?
- MySQL RegExp to fetch records with only a specific number of words
- How can fetch records from specific month and year in a MySQL table?
- 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
- Fetch a specific column value (name) in MySQL
- 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)
- MySQL query to find a match and fetch records
- MySQL db query to fetch records from comma separate values on the basis of a specific value
- MySQL query to fetch records from a range of months?
- Fetch the count of a specific date in a MySQL table
- How to add a string containing double quote to records in MySQL?