We help IT Professionals succeed at work.
Get Started

Get Lastest Record

dbasaurus
dbasaurus asked
on
213 Views
Last Modified: 2012-05-12
I have a table with the following schema:

CREATE TABLE `employee_login_daily` (
  `employee_id` int(10) unsigned NOT NULL,
  `login_date` int(10) unsigned NOT NULL,
  `ip` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`employee_id`,`login_date`),
  KEY `ip` (`ip`),
  KEY `login_date` (`login_date`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

What I am trying to do is to get every employees last log in date based of IP.

For example, for this data:

1   2011-10-01 123.456.678.987
1   2011-10-05 123.456.678.987
1   2011-11-01 123.456.678.987
1   2010-10-01 123.456.678.999

I want to see this returned:

1   2011-11-01 123.456.678.987
1   2010-10-01 123.456.678.999
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
This problem has been solved!
Unlock 3 Answers and 3 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE