Re: select statement
Posted in 1999
Use an outer joing for the 'address' table.
select info.name, address.phone, count(info.id) from info, outer address
whereinfo.name=address.name group by info.name
----- Original Message -----
From: L'der Sachse <sachse@aeb.de>
To: <informix-list@iiug.org>
Sent: Friday, April 09, 1999 3:36 AM
Subject: select statement
> Hi!
>
> I have two tables: One with customer related information and one with
> customer addresses.
> I want to list the number of entries that every customer has in the
> first table so what I did is:
>
> select info.name, address.phone, count(info.id) from info, address where> info.name=address.name group by info.name
>
> This works fine except that some of the customers in the info table
> don't have entries in the address table and they don't get displayed.
> How can I get include them into this select with a null value for
> address.phone?
>
> Thanks in advance.
>
> Lueder
>
>