Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Joining the same table 5 times to the same column in a master table using different where clauses

$
0
0

Hello,

I'm using SSRS 2008 to query an Oracle database.

I have a master table EQUIP that holds equipment, with the primary key being EQUIP_NO.

Another table NAMEPLATE, holds different values under an ATTRIBUTE_NAME column (such as MANUFACTURER, MODELTYPE, VOLT and AMP) with the corresponding data for these in the next column ATTRIBUTE_VALUE. It also has an EQUIP_NO column. Alot of the ATTRIBUTE_VALUE values are null.

I have to create a neat tabbed view of the data, showing the EQUIP_NO, MANUFACTUER, MODELTYPE, VOLT etc, which means I need to attach the same table 5 times to the master table, under different aliases, with 5 different where clauses, to the same master table column and still retrieve all the null values in a row.

If anyone could give me a clue as to how to start the SQL it would be appreciated!

Thank you,

Neil


Viewing all articles
Browse latest Browse all 8428

Trending Articles



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