• 20-06-2016, 18:25:56
    #1
    select count(kolon1) as kolontopla from table group by kolon1 order by kolontopla desc
    Table içindekiler

    kolon1 ///// Kolon 2

    XXXXXX ////// XXXXXX
    XXXXXX ////// XXXXXX
    XXXXXX ////// XXXXXX
    XXXXXX ////// XXXXXX
    aaa ////// XXXXXX
    aaa ////// aaa


    ( Asıl Soru , Kolon1 ve kolon 2 deki benzerleri toplayıp order by nasıl koyarım? şu an mevcut kolon1 için order by desc vardır )


    Yukarıdaki tabloya göre Final Çıktı order bylı kolon1 + 2


    XXXXXX 9 tane var
    3 tane aaa var
  • 22-06-2016, 01:14:36
    #2
    select count(kolon1) as kolontopla from table group by kolon1 order by HAVING kolontopla desc
  • 25-06-2016, 13:41:14
    #3
    Bu yazdığınız benimki ile aynı şey ben tam olarak aşağıdaki gibi istiyorum fakat böyle bir kullanım yok;

    select count(kolon1) as kolontopla from table group by kolon1 order by HAVING count(kolon1) + count(kolon2) desc