cor*_*iKa 2 sql syntax left-join
所以我的查询有问题,我真的不明白在哪里.注释放在语法错误的位置.查询要大得多,我试图缩短它以进行有效但更整洁的查询.
这是使用odbc连接到Progress数据库.我被告知它使用严格的SQL-92.
SELECT itemcust."item-cust",
itemcust."cust-no",
corptreeCust.code
FROM pub."item-cust" itemcust
JOIN pub.customer cust
left join pub.salesstructcustomer struct
on ( struct."corp-cust-type" = cust."corp-cust-type"
and struct."corp-cust-num" = cust."corp-cust-num"
)
left join pub.corptree corptreeCust
on ( corptreeCust.uid = struct.corptreeid /* program says SQL Syntax error here */
and corptreeCust.category = 'store'
)
where ( itemcust."in-entity" = {$entity} or itemcust."in-entity" = '*')
and itemcust."item-no" = {$itemno}
and ( itemcust."cust-no" = {$custno} or itemcust."cust-no" = '*')
and cust."cust-no" = {$custno}
Run Code Online (Sandbox Code Playgroud)
谢谢!
| 归档时间: |
|
| 查看次数: |
127 次 |
| 最近记录: |