Click here to Skip to main content
15,904,348 members
Home / Discussions / Database
   

Database

 
GeneralRe: How can I run SQL ver 9.0 Pin
Majid Shahabfar25-Feb-06 19:10
Majid Shahabfar25-Feb-06 19:10 
AnswerRe: How can I run SQL ver 9.0 Pin
Dave Kreskowiak26-Feb-06 1:48
mveDave Kreskowiak26-Feb-06 1:48 
QuestionData access Layer Pin
Dotnet2Learner24-Feb-06 17:02
Dotnet2Learner24-Feb-06 17:02 
AnswerRe: Data access Layer Pin
Colin Angus Mackay24-Feb-06 17:04
Colin Angus Mackay24-Feb-06 17:04 
GeneralRe: Data access Layer Pin
Dotnet2Learner24-Feb-06 17:50
Dotnet2Learner24-Feb-06 17:50 
GeneralRe: Data access Layer Pin
Dave Kreskowiak25-Feb-06 17:15
mveDave Kreskowiak25-Feb-06 17:15 
QuestionSQL help Pin
sebastian yeok24-Feb-06 15:24
sebastian yeok24-Feb-06 15:24 
AnswerRe: SQL help Pin
Colin Angus Mackay24-Feb-06 17:03
Colin Angus Mackay24-Feb-06 17:03 
You have to use a JOIN.
SELECT parent.*, child.*
FROM Forum AS parent
INNER JOIN Forum AS child ON parent.TopicId = child.RelTopicId
WHERE [Date] >= '2006-02-13' 
AND [Date] <= '2006-02-14' 
AND parent.RelTopicId = 0

Please note that it is bad practice to use SELECT * in production code. Its find for doing quick queries in the Query Analyzer, but not here. Also be aware that as it stands, because of the use of the * there will be duplicate column names because parent and child refer to the same real table. You may want to write something like:
SELECT parent.TopicId AS parent_TopicId, 
       parent.Subject AS parent_Subject, 
...
       child.TopicId = child_TopicId,
...


ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

QuestionCoding efficiency question Pin
Vodstok24-Feb-06 9:42
Vodstok24-Feb-06 9:42 
AnswerRe: Coding efficiency question Pin
Expert Coming24-Feb-06 10:05
Expert Coming24-Feb-06 10:05 
GeneralRe: Coding efficiency question Pin
Vodstok27-Feb-06 2:24
Vodstok27-Feb-06 2:24 
GeneralRe: Coding efficiency question Pin
Andy Brummer27-Feb-06 18:53
sitebuilderAndy Brummer27-Feb-06 18:53 
AnswerRe: Coding efficiency question Pin
Andy Brummer27-Feb-06 18:56
sitebuilderAndy Brummer27-Feb-06 18:56 
GeneralRe: Coding efficiency question Pin
Vodstok28-Feb-06 1:44
Vodstok28-Feb-06 1:44 
QuestionSQL+C# Pin
papa198024-Feb-06 7:16
papa198024-Feb-06 7:16 
AnswerRe: SQL+C# Pin
Colin Angus Mackay24-Feb-06 16:52
Colin Angus Mackay24-Feb-06 16:52 
GeneralRe: SQL+C# Pin
papa198026-Feb-06 22:25
papa198026-Feb-06 22:25 
GeneralRe: SQL+C# Pin
Colin Angus Mackay26-Feb-06 22:34
Colin Angus Mackay26-Feb-06 22:34 
GeneralRe: SQL+C# Pin
papa198027-Feb-06 0:41
papa198027-Feb-06 0:41 
Questionadding rows is access database file Pin
iramg24-Feb-06 3:44
iramg24-Feb-06 3:44 
AnswerRe: adding rows is access database file Pin
papa198024-Feb-06 4:37
papa198024-Feb-06 4:37 
GeneralRe: adding rows is access database file Pin
iramg24-Feb-06 4:42
iramg24-Feb-06 4:42 
AnswerRe: adding rows is access database file Pin
Seivan25-Feb-06 2:28
Seivan25-Feb-06 2:28 
QuestionWork with var Pin
papa198024-Feb-06 1:37
papa198024-Feb-06 1:37 
AnswerRe: Work with var Pin
Colin Angus Mackay24-Feb-06 1:53
Colin Angus Mackay24-Feb-06 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.