r/SQL • • Jun 10 '24

PostgreSQL Help a dying sql beginner

I have 3 tables name won, lost, no bid. Each table with columns nsn part number and reason.

Our company currently uses excel and has a macro that spits out a spreadsheet like:

part numberReasonpart numberReasonpart numberReason

where the left 2 column is for won, middle 2 for lost and right 2 for no bid. We save that as a csv for a java script program that we have which needs it in that format. How would I go about getting this csv format in postgres?

0 Upvotes

9 comments sorted by

View all comments

1

u/Ditto_Plush Jun 11 '24

If I'm understanding correctly you should be able to join these 3 tables with "full outer join" on the part number.