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 |
|
fantasimus
Starting Member
4 Posts |
Posted - 2005-10-25 : 11:59:43
|
| Hi, i want to query the database for this forum function:show me all topics in which i anwsered with my highest postidexample: my post number is 13 and the total posts are 30.. so it should look like this, that the postid is 13 ..my postid should be showntables:topic topicid INTREPLYS ID INT TOPICID INT POSTID smallint // a sequ. number for the topic (1,2,3,4,5....) USERID INTSELECT distinct(topicid),postidFROM topic T INNER JOIN replys R ON T.topicid = R.topicidWHERE (R.userid = 10)ORDER BY T.topicid DESCthis sql statement is wrong. it shows me all topicids with the postid:-(((hope you got me |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-26 : 01:18:03
|
| Post some sample data and the result you wantMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|