如何在Laravel中正确使用内联接

时间:2019-07-03 20:25:56

标签: php sql sql-server laravel

我正在尝试在Laravel中使用许多联接构建查询,但是我找不到正确的方法。

这是sql中的查询:

$query = "SELECT * FROM SAP WHERE intSapID in (SELECT DISTINCT S.intSapID FROM SAP S
                            INNER JOIN Rub_Check R ON 
                            S.strProperty = R.strProperty
                            and S.gdDocDate = R.gdElinkDate
                            and S.strVendor = R.strVendorNum
                            and S.fltAmount = R.fltAmount
                            and S.strReference = R.strVoucher
                            where S.strDocType = 'KC' and R.intidentificador = '$szID')";

0 个答案:

没有答案