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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-02-11 : 08:48:52
|
| Johnny writes "OS: Windows 2000 Adv. Server SP2DB: SQL Server 2000 and/or MS AccessIf I have two tables set up like this:table1: issueID, issueName, isCurrentIssuetable2: issueID, articleName, articleAuthor, articleDate, articleTopicIs there any way I can use a query to check table1.isCurrentIssue, and if it meets a criteria, union the two tables but only display the records from table2 where table2.issueID equals table1.issueID after the appropriate table1.issueID has been chosen?I have in table1 the past issues of a magazine, with a field where I can specify whether or not the issue is the last/current issue. In table2 is a listing of articles in that are contained in each issue, with the issueID field tying the two tables together. I want to keep the two tables separate so that I don't have to have extra fields in each record.Thanks in advance for any help.Johnny Cook" |
|
|
Lou
Yak Posting Veteran
59 Posts |
Posted - 2002-02-12 : 12:49:26
|
| table1: issueID, issueName, isCurrentIssuetable2: issueID, articleName, articleAuthor, articleDate, articleTopicselect table2.*from table1 JOIN table2on table1.issueID = table2.issueIDwhere table1.isCurrentIssue = 1 |
 |
|
|
|
|
|
|
|