by Horizon » Sat May 16, 2020 3:21 pm
vilian wrote:Have you already tried by this way ?
- Code: Select all Expand view
SELECT m.IID, m.KAYIT_NO, m.T1_INFAZ, m.D_DAIRE, m.DOSNO, m.REF_NO1, m.REF_NO2, m.SONKOD, c1.ALACAK, c2.BORCLU, c3.MH_5
FROM icrakart AS m
LEFT JOIN alacak AS c1 ON m.IID = c1.AL_NO
LEFT JOIN borc AS c2 ON m.IID = c2.BR_NO
LEFT JOIN mahkeme AS c3 ON m.IID = c3.MH_NO
ORDER BY m.IID DESC
Yes, I have tried. Result is not same.
Your advice : (just one change. iid=46)
- Code: Select all Expand view
SELECT m.IID, m.KAYIT_NO, m.T1_INFAZ, m.D_DAIRE, m.DOSNO, m.REF_NO1, m.REF_NO2, m.SONKOD, c1.ALACAK, c2.BORCLU, c3.MH_5
FROM icrakart AS m
LEFT JOIN alacak AS c1 ON m.IID = c1.AL_NO
LEFT JOIN borc AS c2 ON m.IID = c2.BR_NO
LEFT JOIN mahkeme AS c3 ON m.IID = c3.MH_NO
WHERE m.IID = 46
ORDER BY m.IID DESC
Result :
- Code: Select all Expand view
IID KAYIT_NO T1_INFAZ D_DAIRE DOSNO REF_NO1 REF_NO2 SONKOD ALACAK BORCLU MH_5
46 55 0 5 2019/10707 11111 \N 0 AKYÜZ HOLDİNG BİRİNCİ BORÇLU \N
46 55 0 5 2019/10707 11111 \N 0 AKYÜZ HOLDİNG İKİNCİ BORÇLU \N
46 55 0 5 2019/10707 11111 \N 0 AKYÜZ HOLDİNG ÜÇÜNÇÜ BORÇLU \N
46 55 0 5 2019/10707 11111 \N 0 AKYÜZ HOLDİNG DÖRDÜNCÜ BORÇLU \N
46 55 0 5 2019/10707 11111 \N 0 AKYÜZ HOLDİNG Av. Birinci Avukat \N
46 55 0 5 2019/10707 11111 \N 0 AKYÜZ HOLDİNG Av. İkinci Avukat \N
46 55 0 5 2019/10707 11111 \N 0 AKYÜZ HOLDİNG BEŞİNCİ BORÇLU \N
My SQL
- Code: Select all Expand view
SELECT m.IID, m.KAYIT_NO, m.T1_INFAZ, m.D_DAIRE, m.DOSNO, m.REF_NO1, m.REF_NO2, m.SONKOD,
(SELECT ALACAK FROM alacak AS c1 WHERE c1.AL_NO = m.IID LIMIT 1) AS ALACAK,
(SELECT BORCLU FROM borc AS c2 WHERE c2.BR_NO = m.IID LIMIT 1) AS BORCLU,
(SELECT MH_5 FROM mahkeme AS c3 WHERE c3.MH_NO = m.IID LIMIT 1) AS MH_5
FROM icrakart AS m
WHERE m.IID = 46
ORDER BY m.IID DESC
Result :
- Code: Select all Expand view
IID KAYIT_NO T1_INFAZ D_DAIRE DOSNO REF_NO1 REF_NO2 SONKOD ALACAK BORCLU MH_5
46 55 0 5 2019/10707 11111 \N 0 AKYÜZ HOLDİNG BİRİNCİ BORÇLU \N
Thanks.
Regards,
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04