>replace still with 1 in 'tab2' for (amount <= 0 or (month1<MONTH(DATE()) and year1<=YEAR(DATE()))) AND no==m.no >