Dear experts,

I have columns coming from two different datasets which also resides in two different tables in the same layout,now i need the difference of that columns.

Example:
sql>select (select mag from one_to_many o, targets16 t where o.new_targetid=t.id) - (select mag from one_to_many o,targets16 t where o.old_uniqueid=t.id) ;
cardinality violation (22>1)
p.s.
these two tables have both 22 rows.


But if I subtract on single values, it works:

select (select avg(mag) from mag1) - (select avg(mag) from mag2);

+--------------------------+

| sql_sub_L1               |

+==========================+

|    -0.015908087452235264 |

+--------------------------+

1 tuple (4.486ms)


can any one help me out?

Thanks In Advance !!!!

Meng