Mysql Date Greater Then

The Tutorial illustrate an example from 'Mysql Date Greater Then' that illustrate you the example to extract the record which is greater than the specified date.

Mysql Date Greater Then

Mysql Date Greater Then

     

The Tutorial illustrate an example from 'Mysql Date Greater Then' that illustrate you the example to extract the record which is greater than the specified date.

Understand with Example

In this Example we create a table 'EMPLOYEE1' in the database.

Step1:-The Create table construct a table name EMPLOYEE1 in the database:-

Query:-

CREATE TABLE EMPLOYEE1 (
ID int(2) NOT NULL auto_increment,
EMPNAME varchar(30),
ATTENDENCE varchar(10), 
DAT date NOT NULL default '0000-00-00',
PRIMARY KEY (ID)
) ;

Output:-

Step2:-Insert the values in the table by giving the query given below:-

Query:-

The Insert into adds the records or rows into the table 'EMPLOYEE1'.

INSERT into EMPLOYEE1 VALUES ('01','Girish','P','2008-12-01'),
('02','Komal','A','2008-12-02'),
('03','Mahendra','P','2008-12-03'),
('04','Sandeep','A','2008-12-04'),
('05','Amit','P','2008-12-05');

Output:-

Step3:-Give the Query to extract the name of the  employee which are greater than the given date

Here in this example we are extracting those employee name which are after the given date i.e :-2008-12-03'

Query:-

SELECT * from EMPLOYEE1 where DAT >='2008-12-03';

Output:-