question

$$ANON_USER$$ avatar image
0 Votes"
$$ANON_USER$$ asked ·

Merging 3 Tables into one New Table

I have one table that has master well data, another that has monthly production data and one that has forecast data. I want to merge them together into a new table. I have attached an Example to show what I am trying to do. Well Data has API, Lease Operator, Production has Production Data, Oil and Gas, Forecast has Monthly Forecast Date Oil and Gas. What I want is to join Master to Production into a new table then when Production stops I want Master to Forecast to start. I have attached an example of the new table I am wanting to insert into. Hopefully this makes sense. I want the Master and Production until Production Stops then Master and Forecast after that combined into a table with Production Date Oil and Gas then Monthly Date Oil and Gas after production stops. Production goes till December 2020 then forecast starts at January 2021 currently but I want Production to take presidence, for example if Production runs till February 2021 and Forecast starts in January 2021 I want Production to run till February 2021 then forecast to start in March 2021. I created a source column so if source is MP then use MP first then use FCST afterwards. Hopefully I explained it correctly. Thanks, [80058-forecast-example.pdf][1] [1]: /answers/storage/attachments/80058-forecast-example.pdf

not-supported
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I would recommend that you edit your post to split it up in paragraphs to make it easier to read.

I may be my browser, but I was not able to open the PDF, and therefore I don't know what's in it.

But generally, it is better to post CREATE TABLE statements for your tables + INSERT statements with sample data and then the desired result given the sample. This makes it easy to copy and paste into a query window. Fancy graphics (if that is what is in the PDF) does not permit us to do that.

0 Votes 0 ·
pituach avatar image pituach ErlandSommarskog ·

Hi Erland,

Don't wast time on this issue.
Notice the name of the user is: $$ANON_USER$$

Click on the user name and you will understand why :-)

0 Votes 0 ·

0 Answers