Skip to content
Advertisement

SQL query to display rows of 2 different tables

I’m trying to figure out how to pull all rows from two different tables with the OutageID = X. The purpose of this is to view the current outage and all the revisions in one statement to see all of the changes. Below is an example I was trying. However, it puts it all in one row. I want it to display all rows separately like you would if you were to query SELECT * From Table WHERE X = Y.

The Current Outages are in one table and the history is in another so they are not written over and not to change the design of the current DB.

Outages Table

Outage History Table

I think that I might need to create a temp table and insert both rows for the results and then Delete the table when its closed. However, I am not sure how to do that. I already feel I may of bitten off more than I can chew with this one. Thank you in advance.

Advertisement

Answer

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement