SQL Language (MOSC)

MOSC Banner

restructure sql

edited Oct 15, 2015 8:37AM in SQL Language (MOSC) 4 commentsAnswered

HI All,

select * from table where emplid ('1','2,'7') and date between to_date('01-OCT-2015') AND to_date('2-OCT-2015')

emplid  hours_worked date

2       8            01-OCT-2015

2       6            02-OCT-2015

it ignores the emplid 1 and 7 since no entries ,i want the data to be in the below format,

emplid  hours_worked date

1       null        01-OCT-2015

1       null        02-OCT-2015

2         8         01-OCT-2015

2         6         02-OCT-2015

7       null        01-OCT-2015

7       null        02-OCT-2015

note i have more than 100 emplid to pass in the IN clause and  i cant filter it other than passing to IN clause ,please let me know if there is any way to restructure this sql.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center