[Linux-programlama] Re: SQL Sorgusu (Birden Çok Alanı İşleyip Where ile Sorgulamak )

---------

[Linux-programlama] Re: SQL Sorgusu (Birden Çok Alanı İşleyip Where ile Sorgulamak )

From: Omer Barlas <omer_at_serbestcagrisim.com>
Date: Wed, 16 Apr 2008 16:05:33 +0300
Message-ID: <4805F99D.9020108@serbestcagrisim.com>

bedo_at_sahbaz.name.tr @ 16-04-2008 15:46:
> Peki, bir alias ile birlikte tabloda olan bir alanı da sorguya sokarsak
> nasıl bir sql cümlesi yazabiliriz?
>
> select id, (a+b+c) as toplam, a, b, c from sil having toplam > 5 and id = 50
>
> gibi bir cümle elbette hata veriyor..

verir, alias yerine real tablo alanları vermeniz lazım, mesela;

select sil.*, (a+b+c) as toplam from sil where id = 50 having toplam > 5

veya sadece bir kaç kolon çekmek için;

select sil.id, sil.c, (a+b+c) as toplam where id = 50 having toplam > 5

gibi.

-- 
Omer Barlas
omer_at_serbestcagrisim.com
_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Wed 16 Apr 2008 - 15:19:46 EEST

---------

Bu arsiv hypermail 2.2.0 tarafindan uretilmistir.