Re: [tr_php:22] Mysql Problemi

0 views
Skip to first unread message
Message has been deleted

Halil İbrahim Türkoğlu

unread,
Aug 18, 2007, 9:24:19 AM8/18/07
to tr_...@googlegroups.com
39 dan 1 e gitmesi bence gayet normal çünkü tarih e göre sıralama yaptırmışsın. eğer sıralmayı ters yaptırırsan veya tpr ye göre yaptırırsan istediğin sonucu alabilirsin sanırım.

+-----------+------------------------------+-------------+-----+-------------------------+
| text_id  | tarih                        | konu_res| tpr | konu_icerik_bilg3 |
+-----------+------------------------------+-------------+-----+-------------------------+
|   58431 | 2007-07-07 00:44:00 | NULL     |  39 | NULL                 |
|   58432 | 2007-07-07 00:52:00 | NULL     |  38 | NULL                 |
+-----------+------------------------------+-------------+-----+-------------------------+
Gördüğün artan kısım tarih bu yüzden tpr düşüyor ters sıra alıyorlar. tpr yi artan sırada dizersen tarih ters sırada olacak.

select  t.text_id,  t.tarih , t.konu_res , count(r.text_id) as tpr, t.konu_icerik_bilg3 from szl_text as t ,
 (select  text_id  from szl_text where durum = 1 and konu_id = 48352 order by text_id) as r where
 r.text_id <  t.text_id and t.konu_id = 48352 and t.durum = 1 group by r.text_id  order by  t.tpr


bu şekilde yaparsan sanırım istediğin olur.
--
Halil İbrahim TÜRKOĞLU
Eğitim Teknoloğu & Bilgisayar Öğretmeni
BÖTE
Reply all
Reply to author
Forward
0 new messages