Thanks to all that reply

Jim,
> Perhaps it is because in the UNION select statement
> MAX() is the first item whereas in the first select it
> is the second item.   Although you can do a union like
> you propose it may not give the result you expect.

I guess this is a limitation. As a result you can't use SEL ...UNION... With
2 different GROUP BY clauses
========================
Albert,
> R:Base is typing one of the two columns incorrectly. Try 
> creating a two column TEMP table and inserting the two SELECT 
> clauses one after the other.

It seems Temp tables is the solution for all limitations!
=======================
Claudine,
> I don't know about the UNION, but I think you need to put 
> parentheses around
> (INT(NATPloiaKvd)) and (MAX(NATPloiaOnoma)).

Yes, I agree, but I have a tendency to omit them and add them when an error
occurs :). Didn't help in this  case.

> 
> > The command:
> > 
> > SEL NATPloiaKvd,MAX(NATPloiaOnoma)+
> >   FROM TNATYphr WHERE INT(NATPloiaKvd) > 0 GROUP BY
> > NATPloiaKvd+
> >   UNION+
> >   SEL MAX(NATPloiaKvd),NATPloiaOnoma FROM TNATYphr
> > WHERE+
> >   INT(NATPloiaKvd) = 0 GROUP BY NATPloiaOnoma
> > 
> > Gives:
> > -ERROR- Column type mismatch in UNION (2372)
> > 
> > Anyone knows why?
> > 
> > TIA
> > Polychronis
> > 
> > 

Reply via email to