Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Joining Table on Primary Key Limits Column's Output

$
0
0

I'm trying to JOIN three tables, using one as a connector to the third.

The issue is that with the primary table and connecting table, there's only one possible primary/foreign key, which also happens to be the essential data I need. When I join the two, it only outputs the data from one the other's column.

For example...

RECEIVABLE contains PRICE and I JOIN with INV_ID to SHIPPER INV_ID (I join SHIPPER because it also contains another key so that I can reference partial shipments to the actual data I need from SHIPPER_LINE)

This enables me to pull PRICE from RECEIVABLE, but RECEIVABLE also contains two types of data in the INV_ID column (INVs and ADJs). Whereas, SHIPPER only contains INVs in the INV_ID column.

As a result, it will only display INVs in the INV_ID column after running. I need both INVs and ADJs from the RECEIVABLE table

...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>