RE: Hiding columns used in GROUP BY and HAVING clauses

2007-06-19 Thread Edward Kay
> -Original Message- > From: Baron Schwartz [mailto:[EMAIL PROTECTED] > Dan Nelson wrote: > > In the last episode (Jun 18), Edward Kay said: > >> From: Dan Nelson [mailto:[EMAIL PROTECTED] > >> > >> At the moment, I have this and it works: > >> > >>select * from conta

Re: Hiding columns used in GROUP BY and HAVING clauses

2007-06-18 Thread Baron Schwartz
Dan Nelson wrote: In the last episode (Jun 18), Edward Kay said: From: Dan Nelson [mailto:[EMAIL PROTECTED] At the moment, I have this and it works: select * from contact_address group by primary_entity_id having count(primary_entity_id) = 1 and is_primary =

Re: Hiding columns used in GROUP BY and HAVING clauses

2007-06-18 Thread Dan Nelson
In the last episode (Jun 18), Edward Kay said: >From: Dan Nelson [mailto:[EMAIL PROTECTED] > > > > > > At the moment, I have this and it works: > > > > > > > > > > select * from contact_address > > > > > group by primary_entity_id > > > > > having count(primary_entity_id) = 1 > >

RE: Hiding columns used in GROUP BY and HAVING clauses

2007-06-18 Thread Edward Kay
> -Original Message- > From: Baron Schwartz [mailto:[EMAIL PROTECTED] > Sent: 18 June 2007 15:53 Sent: 18 June 2007 15:11 > > > > > > > > At the moment, I have this and it works: > > > > select * from contact_address > > group by primary_entity_id > >

Re: Hiding columns used in GROUP BY and HAVING clauses

2007-06-18 Thread Baron Schwartz
Edward Kay wrote: -Original Message- From: Dan Nelson [mailto:[EMAIL PROTECTED] Sent: 18 June 2007 15:11 At the moment, I have this and it works: select * from contact_address group by primary_entity_id having count(primary_entity_id) = 1 and is_p

RE: Hiding columns used in GROUP BY and HAVING clauses

2007-06-18 Thread Edward Kay
> -Original Message- > From: Dan Nelson [mailto:[EMAIL PROTECTED] > Sent: 18 June 2007 15:11 > > > > At the moment, I have this and it works: > > > > > > > > select * from contact_address > > > > group by primary_entity_id > > > > having count(primary_entity_id)

Re: Hiding columns used in GROUP BY and HAVING clauses

2007-06-18 Thread Dan Nelson
In the last episode (Jun 18), Edward Kay said: > From: Dan Nelson [mailto:[EMAIL PROTECTED] > > In the last episode (Jun 15), Edward Kay said: > > > I have a table of addresses. Each address is associated with a > > > primary entity and a primary entity can have n different > > > addresses. For eac

RE: Hiding columns used in GROUP BY and HAVING clauses

2007-06-18 Thread Edward Kay
> -Original Message- > From: Dan Nelson [mailto:[EMAIL PROTECTED] > Sent: 15 June 2007 19:24 > To: Edward Kay > Cc: MySQL List > Subject: Re: Hiding columns used in GROUP BY and HAVING clauses > > > In the last episode (Jun 15), Edward Kay said: > >

Re: Hiding columns used in GROUP BY and HAVING clauses

2007-06-15 Thread Dan Nelson
In the last episode (Jun 15), Edward Kay said: > I have a table of addresses. Each address is associated with a primary > entity and a primary entity can have n different addresses. For each primary > entity, one address is marked as the main address. > > I need a query to return all addresses tha

Re: Hiding columns used in GROUP BY and HAVING clauses

2007-06-15 Thread Baron Schwartz
Hi Edward, Edward Kay wrote: I have a table of addresses. Each address is associated with a primary entity and a primary entity can have n different addresses. For each primary entity, one address is marked as the main address. I need a query to return all addresses that are the only address as