I think what you want to do is a JOIN
:
SELECT d1.kapino AS kapino, d1.adet + d2.adet AS adet_new
FROM depoyaeklenecek d1
INNER JOIN depoadetleri d2 ON d1.kapino = d2.kapino
Based on that you can do all kinds of other stuff, such as summing the values of adet
etc.
Based on the comments:
SELECT kapino, small_counts.count - big_counts.count AS required
FROM (
SELECT kapino, COUNT(1) count
FROM depoyaeklenecek
GROUP BY kapino
) small_counts
INNER JOIN (
SELECT kapino, COUNT(1) count
FROM depoadetleri
GROUP BY kapino
) big_counts ON small_counts.kapino = big_counts.kapino
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…