Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Using relational table to find overlaps

$
0
0
I have 3 tables:

Databases (DB):
DB_ID
Database_Name
...

Journals (JNLS):
JNL_ID
Journal_Name
...

DB_JNLS:
DB_JNL_ID
Database (DB_ID)
Journal (JNL_ID)
...

I can easily view the DB_JNLS table and select specific databases, which results in an "OR" query. What I really need is to know the overlap of two databases - which titles are listed in both databases.

The only thing I have had any success with was to create separate queries of DB_JNLS for each database and then use inner join on the Journal. I just can't help but think that there is an easier and more elegant way. But I must admit, I'm weak on very complex queries.

Does anybody have a suggestion or a direction to point?

Thanks.
Karen Harker

Viewing all articles
Browse latest Browse all 13329

Trending Articles