- Impact
- 10
Guys, I'm fighting with this problem several hours. Can someone tell me why this query gives me 4 rows (as it should):
SELECT SUM(18 * 4) AS price
UNION
SELECT SUM(7 * 4 * 2) AS price
UNION
SELECT SUM(6 * 4 * 2) AS price
UNION
SELECT SUM(15 * 0.445179 * 4) AS price
And this query gives me only 3 rows:
SELECT SUM(18 * 4) AS price
UNION
SELECT SUM(7 * 4 * 2) AS price
UNION
SELECT SUM(9 * 4 * 2) AS price
UNION
SELECT SUM(15 * 0.668134 * 4) AS price
It is tested on mysql database.
SELECT SUM(18 * 4) AS price
UNION
SELECT SUM(7 * 4 * 2) AS price
UNION
SELECT SUM(6 * 4 * 2) AS price
UNION
SELECT SUM(15 * 0.445179 * 4) AS price
And this query gives me only 3 rows:
SELECT SUM(18 * 4) AS price
UNION
SELECT SUM(7 * 4 * 2) AS price
UNION
SELECT SUM(9 * 4 * 2) AS price
UNION
SELECT SUM(15 * 0.668134 * 4) AS price
It is tested on mysql database.
Last edited: