Multiple LEFT JOINS in dbf (dBase)

时间:2016-12-02 05:17:57

标签: c# left-join oledb dbase

I am trying to run a query on dbf files in C# using OLEDB like this

SELECT *
FROM table1
LEFT JOIN table2 USING ID
LEFT JOIN table3 USING ID

But I get en error "Syntax error (missing operator) in query expression"

Tried to execute the same query in Corel Paradox - it works!

2 个答案:

答案 0 :(得分:0)

I've found that I have to change it like this

SELECT *
FROM ((table1)
LEFT JOIN table2 USING ID)
LEFT JOIN table3 USING ID

I've found an article on same issue that occured in MS Access

答案 1 :(得分:0)

我不相信如果使用基于FoxPro的驱动程序,并且可能OleDB驱动程序通常不支持USING子句。您可能需要明确使用ON命令。

SELECT *
   FROM table1
      LEFT JOIN table2 
         on table1.ID = table2.ID
      LEFT JOIN table3 
         on table1.ID = table2.ID