SELECT `sadvocatelist`.`er_no`,`sadvocatelist`.`name`,`sadvocatelist`.`fmonth` as month_paid_till,`sadvocatelist`.`fyear` as year_paid_till, month(date('2022-01-01')) as impl_month, year(date('2022-01-01')) as impl_year, ( feeval.sl- (select sl from feeval where month=month(date('2022-01-01')) and year=year(date('2022-01-01'))))*(50-feeval.s_fee) as arr_val, feeval.sl  FROM `sadvocatelist`, feeval where feeval.month=`sadvocatelist`.`fmonth` and feeval.year=`sadvocatelist`.`fyear` and feeval.sl>(select sl from feeval where month=month(date('2022-01-01')) and year=year(date('2022-01-01')))