RE: [PHP-DB] A little SQL help

From: Date: Thu, 31 Jan 2008 14:33:47 +0000
Subject: RE: [PHP-DB] A little SQL help
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-44548@lists.php.net to get a copy of this message
sorry, went to bed getting a sql error 1064 error in syntax bastien> Date: Thu, 31 Jan 2008 15:48:02 +1100> From: dmagick@gmail.com> To: bastien> bastien_k@hotmail.com> CC: php-db@lists.php.net> Subject: Re: [PHP-DB] A little SQL help> bastien> > Bastien Koert wrote:> > Hi All,> > > > Got myself stuck in a little sql here bastien> and can't seem to work out what I am doing wrong> > > > SELECT > > DISTINCT bastien> (tour.record_id), tour.event_start_date, tour.event_end_date, tour.event_name,CASE WHEN result is bastien> NULLTHEN 'N/A'ELSE angler_results.resultEND CASE > > FROM > > tourLEFT OUTER bastien> JOIN angler_results > > ON angler_results.tour_id = tour.record_idWHERE bastien> angler_results.angler_id =1> > > > where the table TOUR is as above in the primary part bastien> of the select and table ANGLER_RESULTS is (record_id, tour_id, angler_id, result)> > Are you bastien> getting an error?> > Are you getting the wrong results?> > Something else?> > -- bastien> > Postgresql & php tutorials> http://www.designmagick.com/ _________________________________________________________________

« previous php.db (#44548) next »