Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : How do I do an Inner Join in QODBC?Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Sample Scripts Forum

 New Topic 
 
 Post Reply 
 How do I do an Inner Join in QODBC? 
 Author   Message 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-02-25 20:11:35

Inner Joins and Left Joins can be done with the following syntax (for a right join, reverse the table order and use a left join):

SELECT * FROM {OJ Invoice INNER JOIN Customer ON
(Invoice.CustomerRefListID = Customer.ListID)}

or:

SELECT * FROM Invoice INNER JOIN Customer ON Invoice.CustomerRefListID = Customer.ListID

Other hints: If you can include a starting value or range of values (> and <) for TxnDate or TimeModified as the first option in your WHERE statement you can improve your performance many times over.

Also there is a pretty big time penalty for using ORDER BY, if you can live without it you can improve performance. It is also faster to specify only the fields you require instead of a wildcard.

Note: Parentheses are required when there are more than two tables being joined:

SELECT COUNT(TxnID) FROM (Invoice INNER JOIN SalesRep ON Invoice.SalesRepRefListID = SalesRep.ListID)
INNER JOIN Employee ON SalesRep.SalesRepEntityRefListID = Employee.ListID

 

  Top 
 New Topic 
 
 Post Reply 

Jump to