Unfortunately I tried to implement what you suggested, but in my case it
didn't work.

I have stories that can have zero or more photos, one or more author, one or
more sections, and one or more active dates.

Trying to join all those items together using your suggestion actually did
return stories with no photo, but I would then get 3 copies of a story that
had 3 photos, and 6 copies of a 2-photo story that appears on 3 days.

What I really need is mysql 4's SELECT blah WHERE (SELECT blah) subselect
feature, but that's not an option either due to the host I'm using. I ended
up writing a simpler query get all the unique story id's for a section, then
doing a foreach loop in PHP to query for all the additional data for the
story where ID = $loopindex. 

I'm sure there's a supermysqlguru out there who cringes when you issue a
bunch of queries in a PHP loop, but it works fine for now.

Thanks though - I'm sure I'll use your suggestion somewhere in the app I'm
working on.

Geoff

> -----Original Message-----
> From: Loren McDonald [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 25, 2003 1:41 PM
> To: Hoffman, Geoffrey; [EMAIL PROTECTED]
> Subject: RE: Need nulls in my join
> 
> 
> Oops....sorry.  That should have been GROUP BY and not GROUP ON
> 
> That's what I get for answering a post at 2am.  :)
> 
> -- 
> Loren McDonald <AKA MisterrMac>
> [EMAIL PROTECTED]
> 
> 
> > This one is relatively simple:
> > 
> > Drop the WHERE evtphoto.phtusage = 1.
> > SELECT it and then GROUP ON it.
> > 
> > --
> > Loren McDonald <AKA MisterrMac>
> 
> 
> 
> 


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to