You are here: Re: SQL question « MsSQL Server « IT news, forums, messages
Re: SQL question

Posted by <dj> on 10/01/25 11:39

Uzytkownik <haroldsphsu@gmail.com> napisal w wiadomosci
news:1139346932.755113.118540@f14g2000cwb.googlegroups.com...
> Hi all,
>
> I have the following table to log events as they happen:
>
> EventID UserID Event Time
> ====== ===== ==== ====
> 1 User 1 Login 08:00:00
> 2 User 1 Logout 11:00:00
> 3 User 1 Login 13:00:00
> 4 User 1 Logout 16:00:00
>
> Is there a way to transform it into the following form?
>
> UserID Login Logout
> ===== ==== =====
> User 1 08:00:00 11:00:00
> User 1 13:00:00 16:00:00
>
> I understand I can log the start and end time instead, but I was just
> wondering if the above is possible?

Change the table to:

EventID UserID Login Logout
=========================

then remember EventID after Login and update the row
after Logout.

regards

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация