André Hänsel wrote:Of course I meant "UNION", but it's probably an interesting question if one> is there a possibility (in MySQL > 4.1) to GROUP BY the result of an
> ONION?
can group by the result of an onion. ;)
Hi, is there a possibility (in MySQL > 4.1) to GROUP BY the result of an ONION? Simply using (SELECT ...) UNION (SELECT ...) GROUP BY ... is not possible, but can it be rewritten? Regards, André...
Hi,
is there a possibility (in MySQL > 4.1) to GROUP BY the result of an ONION?
Simply using (SELECT ...) UNION (SELECT ...) GROUP BY ... is not possible,
but can it be rewritten?
Regards,
André
André Hänsel wrote:Of course I meant "UNION", but it's probably an interesting question if one> is there a possibility (in MySQL > 4.1) to GROUP BY the result of an
> ONION?
can group by the result of an onion. ;)
André Hänsel wrote:I don't know about Onions, but for Unions, sure you can:> Hi,
>
> is there a possibility (in MySQL > 4.1) to GROUP BY the result of an ONION?
> Simply using (SELECT ...) UNION (SELECT ...) GROUP BY ... is not possible,
> but can it be rewritten?
>
> Regards,
> André
>
>
SELECT
textxcol, SUM(numcol)
FROM
(
select textcol,numcol from table1 where whatever
union
select textcol,numcol from table2 where whatever else
) as t
GROUP BY
textcol
ciao
gmax
--
_ _ _ _
(_|| | |(_|>< The Data Charmer
_|
[url]http://datacharmer.blogspot.com/[/url]
Bookmarks