Quantcast
Viewing latest article 4
Browse Latest Browse All 17

SQL Table Join when the name of a column in Table1 equals the value of a column in Table2

Does anyone know how to write the SQL to join two DB2 tables when the name of Table1.columnA equals the data values stored in Table2.columnB?

In the table structure examples listed below, I’m trying to figure out how to join Table1 and Table2 when the values in Table2.Tag_Name are equal to the column names in Table1, i.e. Public_Housing, Private_Funding, Public_Education

Table1.
Account_Id
Status_Id
Public_Housing
Private_Funding
Public_Education

Table2.
Group_Id
Tag_Id
Tag_Name

Thanks.

The post SQL Table Join when the name of a column in Table1 equals the value of a column in Table2 appeared first on IT Answers.


Viewing latest article 4
Browse Latest Browse All 17

Trending Articles



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