1

这与我之前的一个问题有关。我有一个带有 3 个连接表的(不是那么)“复杂”查询。这是查询:

    select  somefield
from WMSTRANSPORT INNER join GMSWmslocationwrkctr On WMSTRANSPORT.TOLOCATION = GMSWMSLOCATIONWRKCTR.WMSLOCATIONID
inner join WMSLOCATIONSUM on WMSTRANSPORT.TOLOCATION = WMSLOCATIONSUM.WMSLOCATIONID
where 
EXPEDITIONSTATUS=3 OR EXPEDITIONSTATUS =4

如何“转换”为 X++ 代码?

4

1 回答 1

2

只需将 ON 子句更改为 WHERE 子句,使用 == 代替 =,然后使用 || 而不是 OR:

select somefield
from WMSTRANSPORT 
where (WMSTRANSPORT.EXPEDITIONSTATUS==3 || WMSTRANSPORT.EXPEDITIONSTATUS==4)
join GMSWmslocationwrkctr where WMSTRANSPORT.TOLOCATION == GMSWMSLOCATIONWRKCTR.WMSLOCATIONID
join WMSLOCATIONSUM where WMSTRANSPORT.TOLOCATION == WMSLOCATIONSUM.WMSLOCATIONID
于 2012-06-28T13:02:09.107 回答