Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Sql Sqldate Mysql Date Greater Then

Related Tutorials


 
 

Share on Google+Share on Google+

Mysql Date Greater Then

Advertisement
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

     

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:-

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 31, 2008

Related Tutorials

Discuss: Mysql Date Greater Then  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:2
jins
April 2, 2011
calender problem

code for calender, which one date selected then another date should be greater or equal to that date in php.
Mahmoud
July 22, 2012
Thanks

thank you for useful tutorial
DMCA.com