The select statement I'm using to create my view has about 4 joins to get to various files that I need, however, there are two main files that I am pulling data from. One is the orders_current [ oC ] and the other is orders_historical [ oH ].
Here's what I need to do:
[ol]
[li]If I find a record in [ oC ] then add the record.[/li]
[li]If I find a record in [ oH ] but not in [ oC ] then add the record.[/li]
[li]If there is a record in both [ oC and oH ] ONLY ADD record from [ oC ][/li]
[/ol]
How to I write this type of query? It seems like it should be simple but for some reason I'm not understanding how to write the code for this.
Here's what I need to do:
[ol]
[li]If I find a record in [ oC ] then add the record.[/li]
[li]If I find a record in [ oH ] but not in [ oC ] then add the record.[/li]
[li]If there is a record in both [ oC and oH ] ONLY ADD record from [ oC ][/li]
[/ol]
How to I write this type of query? It seems like it should be simple but for some reason I'm not understanding how to write the code for this.