Hi, I have the following table :
-->select * from jvat; ----------------------------------------------- | VATCODE | VATVAL | ----------------------------------------------- | 0 | 0.0 | | 21 | 21.0 | | 6 | 6.0 | | LG | 0.0 | ----------------------------------------------- 4 rows selected. When I do the following select, the result is ok : -->select (select sum(vatval) from jvat) - (select sum(vatval) from jvat where vatcode='LG') from jdummy; -------------------------- |(SELECT SUM(VATVAL) FROM| -------------------------- | 27.0 | -------------------------- 1 row selected. But the following seems a bit odd to me, I would say the result should be 27. -->select (select sum(vatval) from jvat) - (select sum(vatval) from jvat where vatcode='XX') from jdummy; -------------------------- |(SELECT SUM(VATVAL) FROM| -------------------------- | | -------------------------- Any suggestions ? Kind regards willy -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
