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 > Data Access, Manipulation & Batch Languages > ANSI SQL > mutiple talbes query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-04, 05:11
RobinMaple RobinMaple is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
mutiple talbes query

How to make sure that all the connections during mutiple talbes query are correctly placed?Are there any simple principles? I always find extra data when query between a couple of tables.
Reply With Quote
  #2 (permalink)  
Old 04-08-04, 05:24
harshal_in harshal_in is offline
Registered User
 
Join Date: Jan 2003
Location: India
Posts: 523
Re: mutiple talbes query

Quote:
Originally posted by RobinMaple
How to make sure that all the connections during mutiple talbes query are correctly placed?Are there any simple principles? I always find extra data when query between a couple of tables.
what database are u targeting?
basically it depends on the isolation level that you have chosen.
And keep all the queries in transaction blocks
Reply With Quote
  #3 (permalink)  
Old 04-08-04, 08:41
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Re: mutiple talbes query

Quote:
Originally posted by RobinMaple
How to make sure that all the connections during mutiple talbes query are correctly placed?Are there any simple principles? I always find extra data when query between a couple of tables.
Do you mean that after you've built a JOIN, you seem to have unwanted rows in the result set (because they slipped through the join conditions)? If that is the case, you need to check the primary keys of all of the tables involved, and make sure that you use them (if possible) for your joins.

If you meant something else, can you give us a few hints ???

-PatP
Reply With Quote
  #4 (permalink)  
Old 04-08-04, 08:43
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: mutiple talbes query

I find sketching a box for each table in thq query, and connecting them with lines for each join condition, helps if I am getting confused. Particularly useful when trying to follow someone else's huge query.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #5 (permalink)  
Old 04-08-04, 21:26
RobinMaple RobinMaple is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Thumbs up Thank

Thanks all! I appreciate all your help.
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