Login    Forum    Search    FAQ   Blog

Board index » Server Side Development » SQL




 Page 1 of 1 [ 4 posts ] 



Author Message
 Post subject: Last time a task has happend 4 a computer
 Post Posted: Thu Nov 19, 2009 6:52 am 
Offline

Joined: Sat Feb 21, 2009 1:05 pm
Posts: 66
hello!! folks i m havin a table T1 with da twenty fields.
Three of da fields are
Code:
COMPUTER_NAME
COMPUTER_TASK
TIMESTAMP_OF_TASK
The dataset can be as follows
Computer_name Computer_task Timestamp_of_task
Paresh_PC reboot time1
Paresh_PC patched time2
Paresh_PC infected time3

Paresh_laptop cured time1
Paresh_laptop reformatted time2

Paresh_server bought time1
Paresh_server installed time2


nd so on.
What I was asked 2 do is 2 come back wid a query that says what
is the last computer_task that was performd by the computers.

Any ideas?
As usual, any help is greatly appreciated

_________________
If your wife wants to learn to drive, don't stand in her way.


Last edited by srinath on Thu Nov 19, 2009 6:53 am, edited 1 time in total.

Top 
 Post subject: Re: Last time a task has happend 4 a computer
 Post Posted: Thu Nov 19, 2009 6:52 am 
Offline

Joined: Sat Feb 21, 2009 11:06 am
Posts: 1794
Code:
SELECT Computer_name, Computer_task, MAX(Timestamp_of_task)
FROM <tablename>


Top 
 Post subject: Re: Last time a task has happend 4 a computer
 Post Posted: Thu Nov 19, 2009 6:52 am 
Offline

Joined: Sat Feb 21, 2009 1:05 pm
Posts: 66
Thanks 4 the input Waterduck.
When I do dis I get almost all da rows back. mainly bcoz of
each of da computer task is diff and in quick succession.

_________________
If your wife wants to learn to drive, don't stand in her way.


Top 
 Post subject: Re: Last time a task has happend 4 a computer
 Post Posted: Thu Nov 19, 2009 6:52 am 
Offline

Joined: Sat Feb 21, 2009 11:06 am
Posts: 1794
What is ur expected result?


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 4 posts ] 




Board index » Server Side Development » SQL


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron