Embedded SELECT

Kem Tekinay ktekinay at mactechnologies.com
Mon Oct 16 12:10:55 CDT 2006


Does that mean it¹s supposed to work but doesn¹t yet? I ask because it seems
like the second SELECT is the temporary table from which I should be able to
do a grouping.

FYI, this exact syntax works in mySQL.


On 10/16/06 10:05 AM, Ivan Smahin at Ivan_Smahin at valentina-db.com wrote:

> On Oct 16, 2006, at 4:53 PM, Kem Tekinay wrote:
> 
>> > Shouldn¹t this code work?
>> >
>> > select tbl.repname as 'name', tbl.majorparty as 'party', sum(tbl.v)
>> > from (
>> > select
>> >  votes as 'v', if(party='dem' or party='gop', name, 'other') as
>> > 'repname',
>> >  if(party='dem' or party='gop', party, '---') as 'majorparty' from
>> > Candidates ) tbl group by tbl.repname, tbl.majorparty
> 
> I think it will not work currently.
> But you can easy split it on two stage:
> 
> Create temporary table as first step and do GROUP BY on it then.
> 
__________________________________________________________________________
Kem Tekinay                                                 (212) 201-1465
MacTechnologies Consulting                              Fax (914) 242-7294
http://www.mactechnologies.com                        Pager (917) 491-5546

  To join the MacTechnologies Consulting mailing list, send an e-mail to:
           mactechnologies_consulting-subscribe at yahoogroups.com









More information about the Valentina mailing list