WHERE DATE_ADD(d,INTERVAL 6 MONTH) >= CURDATE( );
mysql>
mysql> CREATE TABLE date_val
-> (
-> d DATE
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> INSERT INTO date_val (d) VALUES('1864-02-28');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO date_val (d) VALUES('1900-01-15');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO date_val (d) VALUES('1987-03-05');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO date_val (d) VALUES('1999-12-31');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO date_val (d) VALUES('2000-06-04');
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> SELECT d FROM date_val WHERE DATE_ADD(d,INTERVAL 6 MONTH) >= CURDATE( );
Empty set (0.00 sec)
mysql>
mysql> drop table date_val;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
Related examples in the same category