query SQL how to check all records from a three table join share the same value

Posted by Stefano on Stack Overflow See other posts from Stack Overflow or by Stefano
Published on 2010-03-30T16:38:21Z Indexed on 2010/03/30 16:43 UTC
Read the original article Hit count: 498

Filed under:

Hello

Since i'm a poor sql developer, i need support to write a sql query for the following scenario (just a simplified example of my situation):
i've got 3 tables, say employe table,department table and companybranch table. the dept column , on the employe table is a fk on the department table; the branch column on the department table is a fk on the companybranch table. Finally more employee are "marked" with the same value . There's a way to select all employes with the same "mark" and, in the same query, check that they work in the same company branch ?

thank you in advance

Stefano

© Stack Overflow or respective owner

Related posts about sql