I usually prefer to work off of the results of SHOW CREATE TABLE 
statements but I think you gave me enough information to make a guess at a 
query.

SELECT e.name, c.telephone
From Employee e
INNER JOIN Contact c
        on e.id = c.employee
WHERE e.sex = 'F'

I assumed that the "employee" field on the contact table contains the ID 
of the employee, was I right?

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


"Miguel Loureiro" <[EMAIL PROTECTED]> wrote on 10/12/2004 01:23:48 
PM:

> Hello, iâm new in this.... I have 2 related tables, how can I see 
> same data from main table ( simple where clause ) and if exists data
> from related table show itââ.confused??
> Main table:         Employee: id, name,sex,age
> Related table:     Contact:id,telephone,employee
> 
> I want to see all female employees and, if exists the respective 
contactsâ
> 
> Thanks 4 your help
> Best Regards
> Miguel Joaquim Rodrigues Loureiro
>  - Software Development * Internet Solutions -
> [image removed] 
> 

Reply via email to