[Linux-programlama] Re: aynı tabloda aynı kolonu sorgulama

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Sühan Erol (suhan@ufotek.com.tr)
Date: Fri 11 May 2007 - 17:27:10 EEST


Select kullan,sum(girisdurumu) from log5 Group by kullan having
sum(girisdurumu)=0;

 

Sorguyu bu şekilde deneyin.

 

From: linux-programlama-bounces@liste.linux.org.tr
[mailto:linux-programlama-bounces@liste.linux.org.tr] On Behalf Of Uzman
Celal Dikici
Sent: Friday, May 11, 2007 5:22 PM
To: linux-programlama@liste.linux.org.tr
Subject: [Linux-programlama] Re: aynı tabloda aynı kolonu sorgulama

 

id olan kolonları idlog yaparak denedim. su alttaki bilgiler geliyor.Benim
istediğim sonuçta ALI_DEMIR hiç gelmemeli.Çünkü en az bir defa girisdurumu=1
olmuş.

 

 

mysql> Select idlog,kullan,sum(girisdurumu) from log5 Group by idlog,kullan
having sum(girisdurumu)=0;
+-------+-----------+------------------+
| idlog | kullan | sum(girisdurumu) |
+-------+-----------+------------------+
| 1 | ALI_DEMIR | 0 |
| 2 | VELI_PARS | 0 |
| 3 | VELI_PARS | 0 |
| 4 | ALI_DEMIR | 0 |
+-------+-----------+------------------+
4 rows in set (0.03 sec)

----- Original Message -----

From: Sühan Erol <mailto:suhan@ufotek.com.tr>

To: linux-programlama@liste.linux.org.tr

Sent: Friday, May 11, 2007 5:15 PM

Subject: [Linux-programlama] Re:aynı tabloda aynı kolonu sorgulama

 

Select id,kullan,sum(girisdurumu) from log5

Group by id,kullan

having sum(girisdurumu)=0

 

 

From: linux-programlama-bounces@liste.linux.org.tr
[mailto:linux-programlama-bounces@liste.linux.org.tr] On Behalf Of Uzman
Celal Dikici
Sent: Friday, May 11, 2007 5:05 PM
To: linux-programlama@liste.linux.org.tr
Subject: [Linux-programlama] aynı tabloda aynı kolonu sorgulama

 

Merhabalar,

 

Alttaki gibi log5 adında bir table ım var, ben bu tabloda sadece
girisdurumu=0 olanları listelemek istiyorum. Fakat aynı zamanda hiçbir zaman
girisdurumu=1 olmayacak.

Yani alttaki örnekte VELI_PARS bu duruma uyuyor, ALI_DEMIR ise uymuyor.Şöyle
bir sorgu istediğimi döndermiyor.

 

 select * from log5 WHERE girisdurumu<>1 UNION SELECT * FROM log5 WHERE
girisdurumu=0;

 

SELECT ... EXIST ile denedim başaramadım. Acaba nasıl bir sorgu atmam
gerekir?

 

Teşekkürler.

 

mysql> desc log5;
+-------------+---------------------+
| Field | Type |
+-------------+---------------------+
| idlog | int(11)
| kullan | varchar(30)
| girisdurumu | tinyint(1)

3 rows in set (0.00 sec)

 

id kullan girisdurumu

1 ALI_DEMIR 0

2 VELI_PARS 0

3 VELI_PARS 0

4 ALI_DEMIR 0

5 ALI_DEMIR 1

6 ALI_DEMIR 1

 

 

  _____

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.