Re: Help wtih a query?
| From: | Brad Bonkoski | Date: | Tue, 30 Jan 2007 22:49:56 +0000 |
| Subject: | Re: Help wtih a query? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248070@lists.php.net to get a copy of this message | ||
Skip Evans wrote:
Hey all, I have the following query: $sql="SELECT count(*) AS count,votes.storyID,stories.title,stories.storyID as sID,stories.approved, stories.story,stories.userID, fname, lnameI believe that is what you are looking for. -BFROMHow would this need to be changed so that it would return rows for the members of the bsp_story_stories table that do not have records in the bsp_story_votes table? Is that what the left/right joins do??? Look up 'left outer join'bsp_story_votesas votes, bsp_story_stories AS stories, users AS usr WHERE votes.storyID=stories.storyID AND stories.userID=usr.id AND stories.contestID=$contestID GROUP BY votes.storyID ORDER BY stories.approved,count DESC, sID ASC LIMIT $b_recno,$recs";
Thanks! Skip