Home » SQL & PL/SQL » SQL & PL/SQL » ORACLE sql HELP NEEDED (Oracle 11 g)
ORACLE sql HELP NEEDED [message #661399] Thu, 16 March 2017 12:03 Go to next message
abhi2varmaarma
Messages: 1
Registered: March 2017
Junior Member
hi guys can some 1 help me with the sql for the below scenario

Table 1
Fact Table
3/16/2017 10 20 30 3/16/2017 01:30-02:00

Table 2
Dim Table
Date Time
3/16/2017 3/16/2017 00:00-00:30
3/16/2017 3/16/2017 00:30-01:00
. .
. .
. .
. .
. .
. .
. .
3/16/2017 3/16/2017 23:00-23:30
3/16/2017 3/16/2017 23:30-00:00


Desired Output
3/16/2017 00:00-00:30 Null Null Null
3/16/2017 00:30-01:00 Null Null Null
. Null Null Null
. Null Null Null
. Null Null Null
3/16/2017 01:30-02:00 10 20 30
. Null Null Null
. Null Null Null
. Null Null Null
3/16/2017 23:00-23:30 Null Null Null
3/16/2017 23:30-00:00 Null Null Null
Re: ORACLE sql HELP NEEDED [message #661400 is a reply to message #661399] Thu, 16 March 2017 12:09 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read
Re: ORACLE sql HELP NEEDED [message #661403 is a reply to message #661399] Thu, 16 March 2017 13:04 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Align the columns in result.
Also always post your Oracle version, with 4 decimals, as solution depends on it.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Previous Topic: calling a function as a input parameter for a stored procedure
Next Topic: oracle transaction
Goto Forum:
  


Current Time: Thu Mar 28 04:36:24 CDT 2024