I know this is a weird request, but the company I’m at has a java program built for an excel macro that format it this way. I need 3 tables, dibbs_nobid, dibbs_lost, dibbs_won.
There’s a similar post about this with 2 tables and I cant seem to add the last table into that one.
3 tables are as follows:
nsn_part_number | Reason |
---|---|
1 | reason1 |
2 | reason2 |
nsn_part_number | Reason |
---|---|
1 | reason1 |
2 | reason2 |
nsn_part_number | Reason |
---|---|
1 | reason1 |
2 | reason2 |
I want it to look like
nsn_part_number | Reason | nsn_part_number | reason | nsn_part_number | Reason |
---|---|---|---|---|---|
1 | reason1 | 3 | reason3 | 5 | reason5 |
2 | reason2 | 4 | reason4 | 6 | reason6 |
select dibbs_nobid.nsn_part_number, dibbs_nobid.reason, dibbs_lost.nsn_part_number , dibbs_lost.reason from (select dn.*, row_number() over (order by nsn_part_number) as seqnum from dibbs_nobid dn ) dibbs_nobid full outer join (select dl.*, row_number() over (order by nsn_part_number) as seqnum from dibbs_lost dl ) dibbs_lost on dibbs_nobid.seqnum = dibbs_lost.seqnum;
This is the code I used to merge two. I dont know how to add the third.
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.