my english is not very good, but I'm trying to explain my self-evidence. I need an advice. I select from one table the sum of the values of each field. and my request looks like this:
SELECT * FROM
(
SELECT SUM(Clicks) AS sales , 'sales' as type
FROM ClicksPerDay
WHERE BannerID = 3456
UNION
SELECT SUM(Clicks) AS rent, 'rents' as type
FROM ClicksPerDay
WHERE BannerID = 3457
) total
which I have:
sales | type
23 | rents
26 | sales
and I need it like this:
sales | rents
26 | 23
source
share