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 |
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2012-04-10 : 02:14:32
|
I have unique data selectselect [text],[start_date],[end_date],[room_id]from Eventsgroup by [text],[start_date],[end_date],[room_id]I just need to display id top 1 in the select for each group by item, how can i do it?I try this, the data duplicate again due to difference on idselect [id],[text],[start_date],[end_date],[room_id]from Eventsgroup by [id],[text],[start_date],[end_date],[room_id] |
|
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2012-04-10 : 02:59:14
|
I got the answer using Max & Group By.Thank You. |
 |
|
|
|
|
|
|