ADO Database Delphi

SELECT
sum((if(isnull(tablename.alan1),0,tablename.alan1))) + sum((if(isnull(tablename.alan2),0,tablename.alan2))) as toplam,
sum((if(isnull(tablename.alan1),0,tablename.alan1))) as t1,
sum((if(isnull(tablename.alan2),0,tablename.alan2))) as t2
FROM
tablename
//mySQL için interbase veya baska bir databasede ne olur bilmem