Quantcast
Channel: DB2 SQL – IT Answers
Viewing all articles
Browse latest Browse all 17

DB2 SQL Confusion

$
0
0

I am failing to understand why the following won’t work

SELECT m.index, SUM(d1.amt), SUM(d2.amt)
FROM master m,
detail d1,
detail d2
WHERE m.index = d1.index
AND m.index = d2.index
AND d2.qalif = 1
GROUP BY m.index

I wrote another sql that does work, I just don’t understand why I get higher values on SUM(d2.amt) than I am expecting.

The post DB2 SQL Confusion appeared first on IT Answers.


Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>