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

How to do multiple joins in SQL

$
0
0

I tried this a few months and it was unsuccessful so I will try again. It would seem as if this can be done.

To begin, I have a data set called List20193. It has 3 fields that the end user wants to have decoded. These are naics, cnty, and sizeclass. I am hoping to use a series of left joins in order to add three new fields (decoded versions of area, industry, and geog).

Below is desired result

naics codetitle cnty areaname sizeclass sizedesc

221122 Electrical power distributors 031 Washoe 1120 to 29 employees

For some background, I have three other tables. Each one of them has the more descriptive field.

For naics, it is called Incodes, cnty corresponds to Geog, and sizeclass goes with sizeclas. If it helps, I can give the schema for these tables

Text
select * from dbo.list201923 as t1 left join dbo.indcodes as t2...

Viewing all articles
Browse latest Browse all 4871

Trending Articles



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