I want to get sum of number of records in two tables in a variable. Following is the code:
declare v_sum int default 0;
declare v_count2 int default 0;
select count(*) into v_sum
from table1;
select count(*) into v_count2
from table2;
set v_sum = v_sum + v_count2;
Is there any way to directly select and add the table2 count in v_sum without creating v_count2 variable.