- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
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
How can we search a record from MySQL table having a date as a value in it?
It can be understood with the help of following example in which we are using the following data from the table named ‘detail_bday’ −
mysql> Select * from detail_bday; +----+---------+------------+ | Sr | Name | Birth_Date | +----+---------+------------+ | 1 | Saurabh | 1990-05-12 | | 2 | Raman | 1993-06-11 | | 3 | Gaurav | 1984-01-17 | | 4 | Rahul | 1993-06-11 | +----+---------+------------+ 4 rows in set (0.00 sec)
Now, in the following two ways we can search records using the date −
mysql> Select * from detail_bday Where Birth_Date = '1993-06-11'; +----+-------+------------+ | Sr | Name | Birth_Date | +----+-------+------------+ | 2 | Raman | 1993-06-11 | | 4 | Rahul | 1993-06-11 | +----+-------+------------+ 2 rows in set (0.00 sec) mysql> Select * from detail_bday Where Date(Birth_Date) = '1993-06-11'; +----+-------+------------+ | Sr | Name | Birth_Date | +----+-------+------------+ | 2 | Raman | 1993-06-11 | | 4 | Rahul | 1993-06-11 | +----+-------+------------+ 2 rows in set (0.00 sec)
- Related Articles
- How to search a record by date in MySQL table?
- How can we fetch a particular row as output from a MySQL table?
- How can I return a record from a table nearest to a user-defined variables value in MySQL?
- How can you delete a record from a table using MySQL in Python?
- Can we select second largest record from a table without using LIMIT clause in MySQL?
- How can we extract a substring from the value of a column in MySQL table?
- How can we remove a column from MySQL table?
- How can we fetch one or more columns as output from a MySQL table?
- How can we insert current date automatically in a column of MySQL table?
- How can we delete a single row from a MySQL table?
- How can MySQL interpret the number and string, having no delimiter, as a date?
- How can we update any value in MySQL view as we can update the values in MySQL table?
- Display record with today and tomorrow’s date from a column with date record in MySQL
- How can we drop UNIQUE constraint from a MySQL table?
- How can we delete multiple rows from a MySQL table?

Advertisements