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 |
|
ani07in
Starting Member
5 Posts |
Posted - 2005-10-26 : 02:06:19
|
| i have a table with following recordsid is auto increment fieldissueid is a numeric fieldid issueid Body1 1 my tite2 2 Testing 3 1 titile1 4 3 titile25 4 titile36 3 titile57 5 titile98 1 titile89 2 titile710 5 titile11the above table is for Forums where people can discuss there queriesnew issueid is generated for every new forum and issueid for the forum will be same for the replies posted for a particular forum.how will i retreive the fields for the first post of any thread....the result for the above table should beid issueid Body1 1 my tite2 2 Testing 4 3 titile25 4 titile37 5 titile9Thanx in advance |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-26 : 02:23:18
|
Try thisSelect T1.* from yourTable T1 inner join ( select min(id) as id,issueid from yourTable group by issueid ) T2on T1.id=T2.id where T1.issueid=T2.issueid MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|