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
Richa Garg
NA
10.9k
4.9m
How to combine a multiple rows in Sql 2005?
Aug 16 2012 12:27 AM
Suppose my database is looks like,
id name date status
1 A 2012-07-16 13:54:02.000 Login
1 A 2012-07-16 13:54:35.000 Logout
1 A 2012-07-16 14:21:22.000 login
1 A 2012-07-16 14:21:36.000 logout
2 B 2012-07-16 14:21:53.000 LOGIN
2 B 2012-07-16 14:41:54.000 LOGOUT
AND I want a output like
id name date login_period
1 A 2012-07-16 (differnece b/w the login and logout time total)
2 B 2012-07-16 (difference b'w the login and logout time)
How can I do this .Please help me out.
Reply
Answers (
5
)
Use Backup in SQL Server 2008
query for distinct records