with x as ( SELECT satis, tarih ,row_number() over (order by satis desc) rn FROM tabloadi WHERE tarih >= DATE_SUB( CURDATE( ) , INTERVAL 30 DAY ) AND kategori ='{$kategorikod}' ) select satis, tarih from x where rn=1