darness adlı üyeden alıntı: mesajı görüntüle
LEFT JOIN cari AS c ON c.takip_kodu = k.kod
LEFT JOIN çevirip deneyin
Maalesef hocam olmadı.

Extsoft adlı üyeden alıntı: mesajı görüntüle
Yanlış hatırlamıyorsam right veya join ile hangi tabloya göre bakmak istediğini belirtiyordun. inner ise iki tablodaki ortak kayıtları getiriyordu. buna göre kayıtlardakileri baz alıp getirmek istersen right join musterilere göre çekmek istersen left join olacak. Deneyip bilgi verebilirsen iyi olur.
[COLOR=#515365][FONT=consolas]SELECT[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    k.*,[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    m.*,[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    c.*,[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    SUM(c.miktar) AS c_miktar,[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    k.alinacak - SUM(c.miktar) AS kalan,[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    k.id AS k_id,[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    m.id AS m_id,[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    c.id AS c_id[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    FROM kayitlar AS k[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    RIGHT JOIN musteriler AS m ON k.musteri = m.id[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    INNER JOIN cari AS c ON c.takip_kodu = k.kod[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    WHERE k.firma =1[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    ORDER BY k.id DESC[/FONT][/COLOR]
Maalesef hocam bu da olmadı.