Home » SQL & PL/SQL » SQL & PL/SQL » How to pass the value to four different columns in a view (Oracle 10g)
How to pass the value to four different columns in a view [message #329031] Mon, 23 June 2008 15:00 Go to next message
orachan
Messages: 1
Registered: June 2008
Junior Member
Hi Oracle gurus,
We have the following scenario. We have four tables similar to the ones mentioned below. All the four tables are snapshot tables, meaning the data would represent what the values were at any given point in time.

I need to create a view by joining all these four tables which I can do using the common columns. The requirement is that there should be only one set of START_DT and END_DT in the view and the filter applied to these columns should get applied to the START_DT and END_DT columns in all the four tables. Please let me know how to implement this. Any help would be greatly appreciated.

Table A:
XX_ID
XX_NAME
START_DT
END_DT

TABLE B:
XX_XXX_ID
XX_XXX_NAME
XX_ID
XX_TYPE
XX_FLAG
START_DT
END_DT

TABLE C:
XX_ID
XX_TYPE
XX_XXX_TYPE
START_DT
END_DT

TABLE D:
XX_XXX_ID
XXX_CD
XXXX_CD
XXXX_XXXXXX_CD
START_DT
END_DT

Regards.
Re: How to pass the value to four different columns in a view [message #329032 is a reply to message #329031] Mon, 23 June 2008 15:01 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow posting guidelines as stated in URL above
Re: How to pass the value to four different columns in a view [message #329065 is a reply to message #329031] Mon, 23 June 2008 23:52 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Post what you tried.

Post a test case: create table and insert statements along with the result you want with these data.

please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel

Previous Topic: CAN I use two cursors like show below
Next Topic: insert next 5 records
Goto Forum:
  


Current Time: Sat Dec 07 02:09:32 CST 2024