elektrik ve günlük kişi sayısı adında 2 tablom mevcut
ve
Kod: Tümünü seç
select
(select k.pax from tblpax k where k.tarih="2014-12-01 00:00:00" ) as kisiSayisi,
(t.toplamtutar/(select k.pax from tblpax k where k.tarih="2014-12-01 00:00:00" )) as Paxhesap,
(t.tuketim/(select k.pax from tblpax k where k.tarih="2014-12-01 00:00:00" )) as PaxTuketim,
t.* from tblelektrik t
where t.birimadi="ELEKTRİK RESORT" and t.tarih="2014-12-01 00:00:00"
ama
Kod: Tümünü seç
select (select k.pax from tblpax k where k.tarih between "2014-12-01 00:00:00" and "2014-12-02 00:00:00" ) as kisiSayisi,
(t.toplamtutar/(select k.pax from tblpax k where k.tarih between "2014-12-01 00:00:00" and "2014-12-02 00:00:00" )) as Paxhesap,
(t.tuketim/(select k.pax from tblpax k where k.tarih between "2014-12-01 00:00:00" and "2014-12-02 00:00:00")) as PaxTuketim,
t.* from tblelektrik t
where t.birimadi="ELEKTRİK RESORT" and tarih between "2014-12-01 00:00:00" and "2014-12-02 00:00:00"
alt sorgu sadece tek değer döndürür şeklinde uyarı alıyorum ilk sıradaki sorguyu satır satır nasıl hesaplata bilirim Yardımlarınız için şimdiden teşekkür ederim.