Hi Nigel, all !
Nigel Peck wrote:
> [[...]]
>
> My query is:
>
> SELECT
> `People`.`person_id`,
> `People`.`name`
> FROM
> `People`
> INNER JOIN
> `Person_postal_addresses`
> ON
> `Person_postal_addresses`.`person_id` = `People`.`person_id`
> WHERE
> `People`.`name` REGE
Johan De Meersman wrote:
Either HAVING, or an additional GROUP BY field of
person_postal_address.person_id should do, I think.
That's great, thanks, just what I needed :)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mys
Either HAVING, or an additional GROUP BY field of
person_postal_address.person_id should do, I think.
On Sat, Mar 14, 2009 at 8:38 PM, Nigel Peck wrote:
> Arthur Fuller wrote:
>>
>> Won't a simple LIMIT 1 do what you want? Or am I missing something?
>
> Thanks for getting back to me. You're missi
Arthur Fuller wrote:
Won't a simple LIMIT 1 do what you want? Or am I missing something?
Thanks for getting back to me. You're missing something, but I probably
didn't explain very well.
There can be multiple matches from the People table, but when more than
one address matches, I get more
Won't a simple LIMIT 1 do what you want? Or am I missing something?
Arthur
On Fri, Mar 13, 2009 at 3:24 PM, Nigel Peck wrote:
> Nigel Peck wrote:
>
>> SELECT
>>`People`.`person_id`,
>>`People`.`name`
>> FROM
>>`People`
>> INNER JOIN
>>`Person_postal_addresses`
>> ON
>>`Person
Nigel Peck wrote:
...
My query is:
SELECT
`People`.`person_id`,
`People`.`name`,
FROM
`People`
INNER JOIN
`Person_postal_addresses`
ON
`Person_postal_addresses`.`person_id` = `People`.`person_id`
WHERE
`People`.`name` REGEXP 'example'
OR
`Person_postal_addresses`.
I'm hoping someone can point me in the right direction for what I need,
to save me trawling through books and Google when I don't know what I'm
looking for.
I'm using an INNER JOIN to query a table that has a one-to-many
relationship with the table in my FROM clause, but I only want one
res