- 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
Display all records ignoring the current date record in MySQL
Let us first create a table −
mysql> create table DemoTable -> ( -> Name varchar(100), -> DueDate datetime -> ); Query OK, 0 rows affected (0.54 sec)
Insert some records in the table using insert command. Let’s say the current date is “2019-07-05” −
mysql> insert into DemoTable values('Chris','2019-06-24'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('Chris','2018-01-01'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Robert','2019-07-05'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('Carol','2019-08-03'); Query OK, 1 row affected (0.22 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
Output
+--------+---------------------+ | Name | DueDate | +--------+---------------------+ | Chris | 2019-06-24 00:00:00 | | Chris | 2018-01-01 00:00:00 | | Robert | 2019-07-05 00:00:00 | | Carol | 2019-08-03 00:00:00 | +--------+---------------------+ 4 rows in set (0.00 sec)
Here is the query to select all rows except those from today −
mysql> select *from DemoTable where date(DueDate) !=curdate();
This will produce the following output displaying the records ignoring the current date record −
Output
+-------+---------------------+ | Name | DueDate | +-------+---------------------+ | Chris | 2019-06-24 00:00:00 | | Chris | 2018-01-01 00:00:00 | | Carol | 2019-08-03 00:00:00 | +-------+---------------------+ 3 rows in set (0.00 sec)
- Related Articles
- Display records ignoring NULL in MySQL
- Display and concatenate records ignoring NULL values in MySQL
- Display records from the current date till rest of the same month in MySQL?
- How to display coming Sunday's date for all the date records in MySQL?
- Update record on a specific date matching the current date in MySQL
- Comparison of varchar date records from the current date in MySQL
- Order date records and fetch the 2nd ordered record in MySQL
- MySQL select * and find record with current date
- Display Timestamp before the current date in MySQL
- Display record with today and tomorrow’s date from a column with date record in MySQL
- Display records after a particular date in MySQL
- Display all records except one in MySQL
- MySQL query to get the current date records wherein one of the columns displays current date
- How to get the difference between date records and the current date in MySQL?
- Display matching repeated date records only once in MySQL

Advertisements