TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mehboob Ali
NA
25
3.1k
i want LastSeen and Location of distinct Names
Sep 4 2019 5:37 AM
Here is the Table
Id Name LastSeen Location
1 john 02/04/2017 14:48 xyz
2 Sid 02/04/2017 22:48 abc
3 Sid 03/04/2017 1:48 asd
and Desired results from Table
Id Name LastSeen Location
1 john 02/04/2017 14:48 xyz
3 Sid 03/04/2017 1:48 asd
Can Some one help withe Query
Reply
Answers (
3
)
2
Amit Mohanty
15
51.7k
6m
Sep 4 2019 7:17 AM
Hey try this
SELECT * FROM tblYourTable A WHERE A.ID = (SELECT MAX(ID) FROM tblYourTable B WHERE A.NAME = B.NAME) ORDER BY ID
Accepted Answer
1
Mehboob Ali
0
25
3.1k
Sep 5 2019 4:54 AM
Thanks Amit Mohantty.
0
Rajanikant Hawaldar
32
38.8k
438.5k
Sep 4 2019 6:47 AM
Hi Mehboob, Refer below thread and try the similar https://stackoverflow.com/questions/16550703/sql-get-the-last-date-time-record
How to create a "new vale" into a existing field
How to increase performance of Sql ?