Hello.
I would like to ask the following questions, i have tried searching but didnt get any more info on them. I am building a forum from scratch and am stuck with these points.
1) I have a Join as shown here, is it possible to get another value from the Users table using another collumn from the Topics table?
I tried another INNER JOIN but it just duplicated the results which i dont want
Topics.LastPost edBy -> Users.ID
Topics.User_ID -> Users.ID
2) When inserting a post i want to retreive the ID created with it, i currently have another select which gets the most recent ID in the table made but that is error prone if two people post at exactly the same time. Is there any other way to achieve this?
I am Using ASP.NET 3.5 SP1 in C#.
Thanks in advance
I would like to ask the following questions, i have tried searching but didnt get any more info on them. I am building a forum from scratch and am stuck with these points.
1) I have a Join as shown here, is it possible to get another value from the Users table using another collumn from the Topics table?
I tried another INNER JOIN but it just duplicated the results which i dont want
Topics.LastPost edBy -> Users.ID
Topics.User_ID -> Users.ID
Code:
SELECT Topics.*, Users.Username FROM Topics INNER JOIN Users ON Topics.LastPostedBy = Users.ID
I am Using ASP.NET 3.5 SP1 in C#.
Thanks in advance
Comment