Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
salmonraju
Yak Posting Veteran
54 Posts |
Posted - 2007-12-07 : 11:47:28
|
hi , I have table like belowTrainID UserID MsgType User Data CreatedDate (dd/mm/yy)1111 1 SystemAinfo xtgdttggt 01/10/071112 1 SystemBinfo xtgsaadggt 04/10/071113 1 SystemCinfo xtgdsatggt 02/10/071114 2 SystemAinfo xtgdstggt 08/10/071115 2 SystemBinfo xtgdstggt 11/10/071116 2 SystemCinfo xtgdstggt 10/10/071117 1 SystemAinfo xtgdstggt 12/10/071118 1 SystemBinfo xtgdstggt 13/10/071119 2 SystemCinfo xtgdstggt 15/10/07user have 3 types of messages (SystemAinfo,SystemBinfo,SystemAinfo) for a 'particular user' a 'particular message' can appear number of times but with different createdDate (column)i want a query to retrive UserData (column) value for SystemBinfo messageType that have maximum createDate for a particular userfrom the above for userid 1 i need the below data1118 1 SystemBinfo xtgdstggt 13/10/07I need query that takes set of Users likeselect UserData form Tab1 UserId in(1,2,3) with MessageType='SystemBinfo' having max(CreateDate) |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
salmonraju
Yak Posting Veteran
54 Posts |
Posted - 2007-12-07 : 11:57:35
|
Sorry i wont Checked that,i Thought that I have to post it on Sql server 2000, I appolise for thatHow can I get for a set of User (given users) only like UserId in(1,2,3)because my production server have lot of records |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-07 : 12:12:27
|
quote: Originally posted by salmonraju Sorry i wont Checked that,i Thought that I have to post it on Sql server 2000, I appolise for thatHow can I get for a set of User (given users) only like UserId in(1,2,3)because my production server have lot of records
Where userid in (1,2,3)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|