Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Join

Status
Not open for further replies.

piterb

Programmer
Oct 14, 2008
11
0
0
PL
Hello
I am wondering if anyone can help me and tell me how to make multi join using TopSpeed ODBC Driver from C#. When I’m joining 2 tables it is OK but when I’m trying to add third table I have got an error "ERROR [42000] [SoftVelocity Inc.][TopSpeed ODBC Driver]Unexpected extra token: inner join". Any solution/advice?

Thx 4 help
Piter
 
Hi Piter,

I do not know waht version of ODBC you have but until version 4, Inner Joins did not work well unless you use the following syntax ::

select faitem.code, faitem.sdesc, faitem.group$, fagrup.desc$, faitem.categ, facatg.desc$, faitem.dept, fadept.name, faitem.locn, falocn.sdesc
from {oj (((faitem inner join fagrup on faitem.group$ = fagrup.code) inner join facatg on faitem.categ = facatg.code) inner join fadept on faitem.dept = fadept.code) inner join falocn on faitem.locn = falocn.code}

Regards
 
Thx for replay i have found this answer on different forum and it works so i wont check yours.

Where clause joins are essentially INNER Joins so:
from Pubs Example (line seperation for clarity only) (brackets may be optional)


SELECT [Sales].[STOREID] AS Sales_STOREID, [Sales].[ORD_NUM],
[Sales].[ORD_DATE], [Sales].[QTY], [Sales].[TITLEID] AS Sales_TITLEID,
[Titles].[TITLEID] AS Titles_TITLEID, [Titles].[TITLE], [Titles].[PUBID] AS
Titles_PUBID, [Titles].[PRICE], [TitleAut].[AU_SS] AS TitleAut_AU_SS,
[TitleAut].[TITLEID] AS TitleAut_TITLEID, [Stores].[STOREID] AS Stores_STOREID,
[Stores].[STORE_NAME], [Publish].[PUBID] AS Publish_PUBID,
[Publish].[PUB_NAME], [Pub_info].[PUBID] AS Pub_info_PUBID,
[Pub_info].[PR_INFO], [Authors].[AU_SS] AS Authors_AU_SS,
[Authors].[AU_LNAME]

FROM
Publish, Titles, Stores , Sales, Authors , TitleAut

where [Publish].[PUBID] =[Pub_info].[PUBID] AND
[Publish].[PUBID] =[Titles].[PUBID] AND
[Titles].[TITLEID] =[Sales].[TITLEID] AND
[Stores].[STOREID] =[Sales].[STOREID] AND
[Authors].[AU_SS] =[TitleAut].[AU_SS] AND
[Titles].[TITLEID] =[TitleAut].[TITLEID]
 
Hi!

In my experimentation, I have found that the syntax I mentioned (ODBC) and the one you have mentioned have similar performance.

If you had posted your query, I could not given more specific help.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top