List:General Discussion« Previous MessageNext Message »
From:<ross Date:May 9 2007 6:03pm
Subject:Re: Query problem
View as plain text  
No I want all the properties only one regardless of how many images are 
attached to them. Think I need a distinct in there somewhere,
----- Original Message ----- 
From: "Jon Ribbens" <jon+mysql@stripped>
To: <mysql@stripped>
Sent: Wednesday, May 09, 2007 6:56 PM
Subject: Re: Query problem


> On Wed, May 09, 2007 at 07:14:38PM +0200, Martijn Tonies wrote:
>> >I have a table of properties that is linked to a table  f images with a 
>> >one
>> property to many images relationship. I >have manged this with nested
>> queries but want to try and do it on one line. My current query
>> >
>> >$query = "SELECT * FROM images, properties WHERE images.property_id =
>> properties.property_id";
>> >
>> >As you can see from the query this returns a row for every image so if a
>> property has 3 images associated with it >it will be returned 3 times.
>>
>> What exactly is your question?
>
> I think he somehow wants to return each property once only but still
> have every image returned in the result.
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
> 


Thread
Query problemross9 May
  • Re: Query problemMartijn Tonies9 May
    • Re: Query problemJon Ribbens9 May
  • Re: Query problemross9 May
  • Re: Query problemMartijn Tonies9 May