List:General Discussion« Previous MessageNext Message »
From:DWeingart Date:September 10 2004 7:23pm
Subject:RE: The UNION makes us strong^H^H^H^Hcrazy
View as plain text  
Ah, so it is.  Thanks.


--
Dave Weingart, Sr. Programmer/Analyst    "I can call modules from the vasty
Private Label Services                    deep." -- "Why, so can I, or so
can
Voice: +1-516-682-1470                    any programmer.  But will they run
FAX  : +1-516-496-3160                    when you do call for them?"

> -----Original Message-----
> From: Martijn Tonies [mailto:m.tonies@stripped]
> Sent: Friday, September 10, 2004 12:24 PM
> To: DWeingart@stripped; mysql@stripped
> Subject: Re: The UNION makes us strong^H^H^H^Hcrazy
> 
> 
> 
> 
> > In a further followup to my needing to combine colummns, I 
> have the two
> > following SELECTS that each work when I do them alone
> >
> > select empssn,paycode_1,payrate_1 from paympe where not 
> paycode_1 = '000'
> > select empssn,paycode_2,payrate_2 from paympe where not 
> paycode_2 = '000'
> >
> > However, when I do
> >
> > select empssn,paycode_1,payrate_1 from paympe where not 
> paycode_1 = '000'
> > union all
> > select empssn,paycode_2,payrate_2 from paympe where not 
> paycode_2 = '000'
> >
> > I get a syntax error
> >
> > According to the docs, this should work in versions past 
> mySQL 4, and I
> seem
> > to be running a version rather later than that
> >
> > mysql  Ver 11.18 Distrib 3.23.52, for pc-linux (i686)
> 
> Isn't this MySQL version 3.23?
> 
> Try a:
> select version()
> 
> 
> > What am I doing wrong here? I have two valid SELECT 
> statements; the field
> > sizes and types are the same (indeed, empssn is the same 
> field).  This
> > SHOULD provide me with what I'm looking for, but...
> 
> With regards,
> 
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, 
> MySQL & MS SQL
> Server.
> Upscene Productions
> http://www.upscene.com
> 
Thread
The UNION makes us strong^H^H^H^HcrazyDWeingart10 Sep
  • Re: The UNION makes us strong^H^H^H^HcrazyMartijn Tonies10 Sep
  • Re: The UNION makes us strong^H^H^H^HcrazyAndy Bakun10 Sep
    • RE: The UNION makes us strong^H^H^H^HcrazyDonny Simonton10 Sep
RE: The UNION makes us strong^H^H^H^HcrazyDWeingart10 Sep