I have a dummy table with two columns and some data in it, depending on the image.
When I execute my following SQL statement, the result of the query is 22. The result should not only be 12? I could not understand why.
Could anyone explain?
SQL:
SELECT sum(a.coluna1)
FROM dados AS A
WHERE EXISTS (SELECT TRUE
FROM dados AS B
WHERE (a.coluna1/b.coluna2) >= 1);