If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > One-to-Many Relationship question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-08-04, 16:56
Programmerbob Programmerbob is offline
Registered User
 
Join Date: Sep 2004
Posts: 1
One-to-Many Relationship question

I am using microsoft access(unfortunately I have no choice) to create queries.

I have a main table that contains information about a book(one) and 2 secondary tables(many)

Book Table
ID,Title

Keyword Table
Keyword, foreign_key(ID from book table)

Author Table
Author Name, foreign_key(ID from book table)

I want to do the following:

Author,Keyword, Title, ID

Say I have the data like this
Book Table:
1 Bob's Poker Tips
2 Bob's Cookbook

Keyword Table
2 Baking
2 Stewing
1 Texas Holdem

Author Table
2 Joe Smith
2 Bob Perini
1 Bob Perini

If I query the author Bob Perini

I'm currently getting from my query:
ID,AUTHOR,KEYWORD,TITLE
1 Bob Perini Texas Holdem Bob's Poker Tips
2 Bob Perini Baking Bob's Cookbook
2 Bob Perini Stewing Bob's Cookbook

I want to get the following:
ID,AUTHOR,KEYWORD,TITLE
1 Bob Perini Texas Holdem Bob's Poker Tips
2 Bob Perini Baking,Stewing Bob's Cookbook

If you don't know the syntax for the Jet SQL engine, then feel free to share the theory or show me a query in someone other sql.

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 09-09-04, 11:09
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
It sounds like you have a Microsoft Access question instead of a design question. Try posting in the Microsoft Access forum.
Reply With Quote
  #3 (permalink)  
Old 09-09-04, 11:23
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
actually, it is (also) very much a design question

this question comes up all the time, and the answer is:

do it with a scripting language after you've applied an ORDER BY to the query to ensure the result rows come back in in the right order to allow current/previous logic

i.e. don't try to do this with sql
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 09-13-04, 13:09
wholesaler25 wholesaler25 is offline
Registered User
 
Join Date: Sep 2004
Location: trenon, tn.
Posts: 2
are people cheating on line poker like 3 people playing at same table talking to each
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On