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

Selecting Columns from 3 Inner Joins - still getting cartesian product

$
0
0
I have 3 tables. They are inner joined. When I choose to select from all three tables I get a cartesian product.

I've used distinct and I've tried cross apply with top 1. Top 1 brings back the right amount of records but it repeats the fields used in that select top N.

Basic question. Can you select from 3 different tables and avoid a cartesian result? I can have all three tables joined and with distinct I can get records from two of the tables without a cartesian. It is when I choose to select from a third is where the cartesian appears.

If this is possible, what other tsql commands/constructs should I be experimenting with? http://imageshack.us/f/255/50353790.png/

Viewing all articles
Browse latest Browse all 13329

Trending Articles