bschave2
asked on
how to create hour rows in oracle select statement with no data
I have a task of pulling data based on the date. If this data does not exists, I need to be able to return 24 blank records. I am doing this for a asp.net gridview. it should look like this, but the contract id I will be passing in via input parameter
hour contract id mw additional mw date_time
1 119
2 119
3 119
4 119
4 119
hour contract id mw additional mw date_time
1 119
2 119
3 119
4 119
4 119
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
this is what I am trying to do. I would like to get three products side by side so that I can create a gridview to edit the data.
option-availability.jpg
option-availability.jpg
>>this is what I am trying to do.
and? Does the query posted in http:#a35375597 using the select I posted in http:#a35369643 not return the correct rows?
Anyway: Can't you just build the gridview with 24 rows?
and? Does the query posted in http:#a35375597 using the select I posted in http:#a35369643 not return the correct rows?
Anyway: Can't you just build the gridview with 24 rows?
ASKER
each row is an hour.
Again, and? I got that part.
The query provided by awking00 should generate 24 rows. Does it not do that?
The query provided by awking00 should generate 24 rows. Does it not do that?
ASKER
my question was based on if there was no data and so it doesn't work unless you have data.
ASKER
nevermind. I just replaced the t.date_time with sysdate. thanks for the help.
Might I ask why you didn't split points?
The accepted answer uses the join and SQL mentioned in my post.
The accepted answer uses the join and SQL mentioned in my post.
This generates a list form 1 to 24:
select level from dual connect by level<=24;