Join two tables to get all fields in table1 and add fields in table2 at end.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am joining two tables (not really tables, excel to an existing work flow).
Table one has hundred lines. Table two has one line.
I need to join in a way that I see all fields of Table1 and the line of table2 are new fields to the end of table1.
The reason being I need to do a case (IF) statement where if fieldX > 2 use table2. fields else use Table1. fields.
This is a very common thing to do in SQL.
I am guessing there is a "join" that allows this, but I have not been able to find it.
Thank you.
Example:
Table1 fields: Dept | Sales | Mature_Flag
Table2 fields: Dept | Sister_Dept | Sales
Join Table1 Dept = Table2 Sister_Dept
Results
Table1.Dept, Table1.Sales,Table2.Dept,Table2.Sister_dept, Table2.Sales
Then I can do an IF statement like this.
IF mature_flag > 2 THEN Table1.sales ELSE Table2.sales ENDIF
Solved! Go to Solution.
- Labels:
- Join
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hey @DuaneS
I believe i've achieved what you need.
Please have a look and let me know, workflow is attached:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
doesn't work. The union puts the new fields as rows. I don't need them as rows. I need a join as table1 and table2 as separate feilds.
