SELECT
tbStok.sModel AS Kod, tbStok.sAciklama AS Adı,
SF.lFiyat AS SF, PSF.lFiyat AS PSF,
TL.lFiyat AS TL , USD.lFiyat AS USD
FROM
tbStok
LEFT JOIN
tbStokFiyati AS TL ON tbStok.nStokID = TL.nStokID
LEFT JOIN
tbStokFiyati AS SF ON tbStok.nStokID = SF.nStokID
LEFT JOIN
tbStokFiyati AS PSF ON tbStok.nStokID = PSF.nStokID
LEFT JOIN
tbStokFiyati AS USD ON tbStok.nStokID = USD.nStokID
GROUP BY
tbStok.sModel, tbStok.sAciklama, SF.lFiyat, PSF.lFiyat, TL.lFiyat,USD.lFiyat
以上是我正在使用的 SQL 语句。
查询开始时,结果为 7255470 行,但tBstok
表中有 18867 行。
我们在tbStok
表格中有产品信息,有 2 个不同的列,例如产品代码和产品名称。在另一个名为 的表中tbStokFiyati
,我需要获取 4 个不同的列。
结果很慢!