-2
I have a fictitious table with two columns and some data in it, according to the image.
When I run my SQL statement below, the result of the query is 22. Shouldn’t the result be only 12? I couldn’t understand why.
Could someone explain to me?
SQL:
SELECT sum(a.coluna1)
FROM dados AS A
WHERE EXISTS (SELECT TRUE
FROM dados AS B
WHERE (a.coluna1/b.coluna2) >= 1);
Solved your question ?
– Rovann Linhalis
Vote today! Vote tomorrow! Vote forever! Vote consciously! Your vote is very important to our community, contribute to us, and help make Stack Overflow in Portuguese (Sopt) bigger and bigger. You can learn more at: Vote early, vote often
– Marcos Henzel