Cats ESS view - into multiple rows when we release times or refresh them
Dear ALL,
We are using the record working times and when we enter the data for the week for 5 days each with 8 hours a day in one row in portal. Once we refresh or review that page it is resulting into multiple rows, like for 5 days five rows each row containing an entry for each day. how can we avoid this, we want all entries maintained into one row only.
Help is appreciated.
Thanks and Regs,
Raj
Made some changes in Data entry profiles
Similar Messages
-
I need to divide selected row into multiple rows when i navigate ADF 11g
Hi
I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
I need to divide selected row into multiple rows when i navigate to other page . Scenario - in first page i'm displaying some records with columns like empno , empstatus , empworkdepts ,curdepts
Here empworkdepts gives the numeric number like no of departments work shifts 3 or 4 or 5. when i select any particular employee and fire next button to navigate next page.I have to divide the selected employee with same information into multiple times based on the empworkdepts value.
empno empstatus empworkdepts curdept
001 eds 2 TS
002 hr 1 FO
003 eds 4 TS
*004 eds 3 TS*
now i selected employee 004 , when i navigate to next page.
Empno EmpStatus EmpWorkDepts CurDept
004 eds 3 TS
004 eds 3 TS
004 eds 3 TS
i did with java code in bean .but not stable .
any help............
thanks advance.............
Edited by: user9010551 on May 5, 2010 10:48 PM
Edited by: user9010551 on May 10, 2010 11:31 PMuser9086775 wrote:
Hi Experts,
I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
Requirment:
This is a sample set record in a table
Product Sub Product Name Age
New Car Nissan Tom 49
New Car Nissan Jack 36
Old Car Audi Sam 24
Old Car Jaguar Pint 26
Old Car Audi Smith 41
I need to be able to fetch the above data in the below fashion
Product Sub Product Name Age
New Car
Nissan
Tom 49
Jack 36
Old Car
Audi
Sam 24
Smith 41
Jaguar Pint 26Please help with ideas as to how can i achive the above without using PLSQL.
Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
For example if you are in SQL Plus you can use the BREAK command. -
Split single row into multiple rows containing time periods
Hi,
I have a table with rows like this:
id, intime, outtime
1, 2010-01-01 00:10, 2010-01-3 20:00
I would like to split this row into multiple rows, 1 for each 24hr period in the record.
i.e. The above should translate into:
id, starttime, endtime, period
1, 2010-01-01 00:10, 2010-01-02 00:10, 1
1, 2010-01-02 00:10, 2010-01-03 00:10, 2
1, 2010-01-03 00:10, 2010-01-03 20:00, 3
The first starttime should be the intime and the last endtime should be the outtime.
Is there a way to do this without hard-coding the 24hr periods?
Thanks,
Dan Scott
http://danieljamesscott.orgThanks for all the feedback, Dan.
It appears that the respective solutions provided will give you: a) different resultsets and b) different performance.
Regarding your 'truly desired resultset' you haven't answered all questions from my previous post (there are differences in the provided examples), but anyway:
I found that using CEIL or ROUND makes quite a difference, using my 'simple 3 record testset' (30 records vs. 66 records got initially returned, that's less than half of the original). That's quite a difference. However, I must call it a day (since it's almost midnight) for now, so there's room for more optimizement and I haven't thoroughly tested.
But this might hopefully make a difference performancewise when compared to my previous 'dreaded example':
SQL> drop table t;
Table dropped.
SQL> create table t as
2 select 1 id, to_date('2010-01-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-01-03 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
3 select 2 id, to_date('2010-02-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-02-05 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
4 select 3 id, to_date('2010-03-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-03-03 00:10', 'yyyy-mm-dd hh24:mi') outtime from dual;
Table created.
SQL> select id
2 , max(intime)+level-1 starttime
3 , case
4 when level = to_char(max(t.outtime), 'dd')
5 then max(t.outtime)
6 else max(t.intime)+level
7 end outtime
8 , level period
9 from t
10 connect by level <= round(outtime-intime)
11 group by id, level
12 order by 1,2;
ID STARTTIME OUTTIME PERIOD
1 01-01-2010 00:10:00 02-01-2010 00:10:00 1
1 02-01-2010 00:10:00 03-01-2010 00:10:00 2
1 03-01-2010 00:10:00 03-01-2010 20:00:00 3
2 01-02-2010 00:10:00 02-02-2010 00:10:00 1
2 02-02-2010 00:10:00 03-02-2010 00:10:00 2
2 03-02-2010 00:10:00 04-02-2010 00:10:00 3
2 04-02-2010 00:10:00 05-02-2010 00:10:00 4
2 05-02-2010 00:10:00 05-02-2010 20:00:00 5
3 01-03-2010 00:10:00 02-03-2010 00:10:00 1
3 02-03-2010 00:10:00 03-03-2010 00:10:00 2
10 rows selected.
SQL> By the way: I'm assuming you're on 10g, is that correct?
Can you give us some information regarding the indexes present on your table? -
Splitting comma seperated column data into multiple rows
Hi Gurus,
Please help me for solving below scenario. I have multiple value in single column with comma seperated values and my requirement is load that data into multiple rows.
Below is the example:
Source Data:
Product Size Stock
ABC X,XL,XXL,M,L,S 1,2,3,4,5,6
Target Data:
Product Size Stock
ABC X 1
ABC XL 2
ABC XXL 3
ABC M 4
ABC L 5
ABC S 6
Which transformation we need to use for getting this output?
Thanks in advance !Hello,
Do you need to do this tranformation through OWB mapping only? And can you please tell what type of source you are using? Is it a flat file or a table?
Thanks -
Why does a mail-merge in MS Publisher split into multiple files when printed as a pdf file?
Why does a mail-merge in MS Publisher split into multiple files when printed as a pdf file?
'Cuz that's what mail merges do. They create multiple documents based on the parent doc and all the names/addresses in your data tables.
Perhaps if you describe exactly what you're trying to do & why you need PDF, we can point you to relevant tutorials.
Nancy O. -
Easy Question: How to split concatenated string into multiple rows?
Hi folks,
this might be an easy question.
How can I split a concatenated string into multiple rows using SQL query?
INPUT:
select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
Expected output:
data
AAA
BBB
CCC
DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
Thanks,
TomasHere is the SUBSTR/INSTR version of the solution:
SQL> WITH test_data AS
2 (
3 SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
4 )
5 SELECT SUBSTR
6 (
7 DATA
8 , INSTR
9 (
10 DATA
11 , ','
12 , 1
13 , LEVEL
14 ) + 1
15 , INSTR
16 (
17 DATA
18 , ','
19 , 1
20 , LEVEL + 1
21 ) -
22 INSTR
23 (
24 DATA
25 , ','
26 , 1
27 , LEVEL
28 ) - 1
29 ) AS NEW_STRING
30 FROM test_data
31 CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
32 /
NEW_STRING
AAA
BBB
CC
DDDD -
Urgent: How to break 1 Row into Multiple Rows
Hi Experts,
I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
Requirment:
This is a sample set record in a table
Product Sub Product Name Age
New Car Nissan Tom 49
New Car Nissan Jack 36
Old Car Audi Sam 24
Old Car Jaguar Pint 26
Old Car Audi Smith 41
I need to be able to fetch the above data in the below fashion
Product Sub Product Name Age
New Car
Nissan
Tom 49
Jack 36
Old Car
Audi
Sam 24
Smith 41
Jaguar Pint 26
Please help with ideas as to how can i achive the above without using PLSQL.
Thanks in advance!user9086775 wrote:
Hi Experts,
I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
Requirment:
This is a sample set record in a table
Product Sub Product Name Age
New Car Nissan Tom 49
New Car Nissan Jack 36
Old Car Audi Sam 24
Old Car Jaguar Pint 26
Old Car Audi Smith 41
I need to be able to fetch the above data in the below fashion
Product Sub Product Name Age
New Car
Nissan
Tom 49
Jack 36
Old Car
Audi
Sam 24
Smith 41
Jaguar Pint 26Please help with ideas as to how can i achive the above without using PLSQL.
Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
For example if you are in SQL Plus you can use the BREAK command. -
Please - immediate help needed parsing csv values into multiple rows
Hello, we have a very immediate need to be able to parse out a field of comma separated values into individual rows. The following is an example written in SQL Server syntax which does not work in Oracle.
The tricky part is that each ROUTES can be a different length, and each CSV can have a different number of routes in it.
Here is an example of the table ("Quotes") of CSV values I want to normalize:
TPNUMBER ROUTES
1001 1, 56W, 18
1002 2, 16, 186, 28
Here is an example of what I need it to look like:
TPNUMBER ROUTES
1001 1
1001 56W
1001 18
1002 2
1002 16
1002 186
1002 28
Here is the "Tally" table for the query below:
ID
1
2
3
4
5
6
7
And finally, here is the query which parses CSV values into multiple rows but which does not work in Oralce:
SELECT TPNUMBER,
NullIf(SubString(',' + ROUTES + ',' , ID , CharIndex(',' , ',' + ROUTES + ',' , ID) - ID) , '') AS ONEROUTE
FROM Tally, Quotes
WHERE ID <= Len(',' + ROUTES + ',') AND SubString(',' + Phrase + ',' , ID - 1, 1) = ','
AND CharIndex(',' , ',' + ROUTES + ',' , ID) - ID > 0
It may be necessary to use a cursor to loop through the CSV table and process each row (a loop within another loop...) but this is beyond my comprehesion of PL/SQL.
Many thanks in advance for your advice/help.
apkNot sure what you are trying to do with the last step, but this should work for the first part. I assume you would use sqlldr but I just did inserts instead. You might need more than 5 "routes" in the csv. You could put some reasonable max on that number of columns:
SQL>create table t_csv
2 (TPNUMBER varchar2(20),
3 ROUTE_1 VARCHAR2(5),
4 ROUTE_2 VARCHAR2(5),
5 ROUTE_3 VARCHAR2(5),
6 ROUTE_4 VARCHAR2(5),
7 ROUTE_5 VARCHAR2(5),
8 ROUTE_6 VARCHAR2(5) );
Table created.
SQL>INSERT INTO t_csv (TPNUMBER,ROUTE_1,ROUTE_2) values( '1001 1', '56W', '18' );
1 row created.
SQL>INSERT INTO t_csv (TPNUMBER,ROUTE_1,ROUTE_2,ROUTE_3) values( '1002 2', '16', '186', '28');
1 row created.
SQL>create table t_quotes(
2 tpnumber NUMBER,
3 routes VARCHAR2(5));
Table created.
SQL>DECLARE
2 L_tpnumber NUMBER;
3 L_route VARCHAR2(5);
4 begin
5 for rec in (select * from t_csv) loop
6 L_tpnumber := SUBSTR(rec.tpnumber,1,INSTR(rec.tpnumber,' ')-1);
7 L_route := SUBSTR(rec.tpnumber,INSTR(rec.tpnumber,' ')+1);
8 insert into t_quotes values( L_tpnumber, l_route );
9 if rec.route_1 is not null then
10 insert into t_quotes values( L_tpnumber, rec.route_1 );
11 end if;
12 if rec.route_2 is not null then
13 insert into t_quotes values( L_tpnumber, rec.route_2 );
14 end if;
15 if rec.route_3 is not null then
16 insert into t_quotes values( L_tpnumber, rec.route_3 );
17 end if;
18 if rec.route_4 is not null then
19 insert into t_quotes values( L_tpnumber, rec.route_4 );
20 end if;
21 if rec.route_5 is not null then
22 insert into t_quotes values( L_tpnumber, rec.route_5 );
23 end if;
24 end loop;
25 end;
26 /
PL/SQL procedure successfully completed.
SQL> select tpnumber, routes from t_quotes;
TPNUMBER ROUTE
1001 1
1001 56W
1001 18
1002 2
1002 16
1002 186
1002 28
7 rows selected. -
I am going crazy changing passwords that do not get recognized by the different services when it is time to use them, until I am asked to change the password again, starting the vicious cycle again: i need to use the password, it does not get recognized three times, then the system asks me to change it again, and again, and I am stuck!! Is there any fix for this "glitch?
The first thing I would suggest is for you to go to the folder containing your catalog, using your system browser. There will be a folder that has the extension .lrdata. Delete that folder, and then try to start Lightroom. If that doesn't work, replace your catalog with your most recent backup.
-
How do I divide a list in one cell into multiple rows?
I have copied lists of data from a website - some lists pasted as I want them (in individual rows), but others pasted the list in one row. Is there an easy way to split a list in a single cell into multiple cells so ultimately I can sort all the rows? I've tried "split the selected cells into rows" in the inspector, but it's not working... seems like it's creating another column instead (?). Any help would be amazing.
K,
I find that Pages has the friendliest Find and Replace dialog, so when I need to swap around the delimiters I go straight to Pages and do the fixes there. Replace whatever is there between columns in the original content with Tab characters and replace whatever is there now for delimiting the rows with the Return character. Since it's sometimes difficult to tell what has been used, just copy it from the content and Paste into the Find field. Choose the Tab or Return character from the Replace drop down menu.
When you have it all fixed up, then paste into Numbers.
Jerry -
Alv output splitting into two rows when converting into excel sheet.
Hi frends,
I have alv report with 60 fields . The report output is coming currently . But when i am exporting into excel sheet from the option local file--> speadsheet each row is splitting into two rows including header in excel sheet.
Please provide your valuable suggestions to avoid this.
Regards,
Ramu .
Edited by: Ramu.K on Sep 8, 2009 5:59 PMHi,
Please use the grid option and with the Spreadsheet button (CntrShiftF7). Do "Save as" and save it as excel. It should work.
Regards,
Pradyumna -
Convert one record row into multiple rows
Hi,
I have small requirement.I have selected one data base record into an internal table.Now internal table has 1 record i.e 1 row(ex: 10 columns). Now i will convert this single row record into multiple records i.e 10 rows( 10 columns wil; be converted into 10 rows). How i will convert this. Please give me any idea on this.
Regards
GeethaHi Geetha,
Search SCN using keyword, " convert Rows into columns" or vice versa,,,
U will get more answers & solutions,
Look at Some of the Previous threads....
Re: How to create a structure of itab as rows as colums and columns rows dy
Re: Transpose rows and columns
CONVERT ROWS INTO COLUMNS IN INTERNAL TABLE
Convert Internal table Rows into columns of another internal table
how to convert columns of an internal table to rows of another internal tab.
Convert Columns into Rows (internal tables) - Urgent Help Pleasse..
converting columns to rows
Thanks & regards,
Dileep .C -
Associate Table1_PK into multiple rows in Table2
Hi,
I have 2 tables... TableOne and TableMany. The values for input are all on the same page. I'm trying to achieve... Inserting the TableOne values (no problem - created a process for insert)... once this is done I want to insert multiple rows into TableMany which associates the PK from TableOne insert to multiple values selected from a Multiselect List. I have setup the coding to obtain the individual elements in the multiselect list but don't know the best way to obtain the PK.
Ideally I'd be able to set the ProcessInsertTableOne sequence to lower than ProcessInsertTableMany and store the PK (created by table PK sequence trigger) into a page item and then use this in the 2nd insert process? Been trying to work around this but still a bit novice in SQL and newbie to ApEx.
Any help or guidance in this regard would be appreciated.
Thanks.
RoryYou should use 2 pages. Input into master record on one page then put a link in and branch to another page containing the details.
Gus -
I have an XML file to inset into multiple tables.
My file is like
<?xml version="1.0" encoding="ISO-8859-1"?>
<DCDS>
<CDS>
<COD></COD>
<COD_INT></COD_INT>
<ULTIMA_MODIFICA></ULTIMA_MODIFICA>
<TIP></TIP>
<DEN></DEN>
<CLS>
<ID></ID>
<DEN></DEN>
</CLS>
<FAC></FAC>
<OBT>
<![CDATA[
]]>
</OBT>
<PRF>
<![CDATA[
]]>
</PRF>
<OCC>
<![CDATA[
]]>
</OCC>
<ACC>
<![CDATA[
]]>
</ACC>
<CUR>
<ID></ID>
<DEN></DEN>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT>
</SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT>
</SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT></SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT></SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT>
</SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT>
</SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT></SETT> <CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN> </CFMIN>
<CFMAX> </CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN> </CFMIN>
<CFMAX> </CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN> </CFMIN>
<CFMAX> </CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN> </CFMIN>
<CFMAX> </CFMAX>
<TP></TP>
</GRP>
</CUR>
</CDS>
</DCDS>
In some cases, like <GRP> tag, I have to insert multiple rows in a table. I found the valueOf, but it extracts only the first value contained.
payment.amount := xpath.valueOf(curNode,'.');
Some tips?I have an XML file to inset into multiple tables.
My file is like
<?xml version="1.0" encoding="ISO-8859-1"?>
<DCDS>
<CDS>
<COD></COD>
<COD_INT></COD_INT>
<ULTIMA_MODIFICA></ULTIMA_MODIFICA>
<TIP></TIP>
<DEN></DEN>
<CLS>
<ID></ID>
<DEN></DEN>
</CLS>
<FAC></FAC>
<OBT>
<![CDATA[
]]>
</OBT>
<PRF>
<![CDATA[
]]>
</PRF>
<OCC>
<![CDATA[
]]>
</OCC>
<ACC>
<![CDATA[
]]>
</ACC>
<CUR>
<ID></ID>
<DEN></DEN>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT>
</SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT>
</SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT></SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT></SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT>
</SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT>
</SETT>
<CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT></SETT> <CF></CF>
<CFMIN></CFMIN>
<CFMAX></CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN> </CFMIN>
<CFMAX> </CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN> </CFMIN>
<CFMAX> </CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN> </CFMIN>
<CFMAX> </CFMAX>
<TP></TP>
</GRP>
<GRP>
<ID></ID>
<DESCAMBITO></DESCAMBITO>
<SETT> </SETT>
<CF></CF>
<CFMIN> </CFMIN>
<CFMAX> </CFMAX>
<TP></TP>
</GRP>
</CUR>
</CDS>
</DCDS>
In some cases, like <GRP> tag, I have to insert multiple rows in a table. I found the valueOf, but it extracts only the first value contained.
payment.amount := xpath.valueOf(curNode,'.');
Some tips? -
I have a table time_entries
create table time_entries
(employee_id integer,
start_date date,
end_date date,
CONSTRAINT pk_time_entries PRIMARY KEY (employee_id, start_date))Suppose I have one row in this table (dates in yyyy-mm-dd format):
employee_id, start_date, end_date
1, 2012-08-27, 2012-09-02
As you can see the difference between the dates is 7 days. I want to write a query so that each day has its own row, i.e. I want to write a query which translates the above 1 row into 7 rows. This is the result set I want:
employee_id, start_date, end_date
1, 2012-08-27, 2012-08-27
1, 2012-08-28, 2012-08-28
1, 2012-08-29, 2012-08-29
1, 2012-08-30, 2012-08-30
1, 2012-08-31, 2012-08-31
1, 2012-09-01, 2012-09-01
1, 2012-09-02, 2012-09-02
Is it possible to do it in one select statement?
Edited by: srhcan on Aug 17, 2012 4:26 PM
Edited by: srhcan on Aug 17, 2012 4:26 PMWITH t
AS (SELECT 1 id,
TO_DATE ('2012-08-27', 'yyyy-mm-dd') start_date,
TO_DATE ('2012-09-02', 'yyyy-mm-dd') end_date
FROM DUAL
UNION ALL
SELECT 2 id,
TO_DATE ('2012-10-27', 'yyyy-mm-dd') start_date,
TO_DATE ('2012-11-02', 'yyyy-mm-dd') end_date
FROM DUAL)
SELECT id, start_date, end_date
FROM t
MODEL
PARTITION BY (id)
DIMENSION BY (0 d)
MEASURES (start_date, end_date, end_date stop)
RULES
ITERATE (10000) UNTIL start_date[ITERATION_NUMBER] = stop[0]
(start_date [ITERATION_NUMBER] = start_date[0] + ITERATION_NUMBER,
end_date [ITERATION_NUMBER] = start_date[0] + ITERATION_NUMBER)
ID START_DATE END_DATE
1 8/27/2012 8/27/2012
1 8/28/2012 8/28/2012
1 8/29/2012 8/29/2012
1 8/30/2012 8/30/2012
1 8/31/2012 8/31/2012
1 9/1/2012 9/1/2012
1 9/2/2012 9/2/2012
2 10/27/2012 10/27/2012
2 10/28/2012 10/28/2012
2 10/29/2012 10/29/2012
2 10/30/2012 10/30/2012
2 10/31/2012 10/31/2012
2 11/1/2012 11/1/2012
2 11/2/2012 11/2/2012
Maybe you are looking for
-
6330 K7T Turbo Limited Ed. Problem
I bought a brand new 6330 K7T Turbo Limited Edition. It shuts down by itself within 10 minutes (sometimes even within 5 sec.). The temperature protection in the BIOS has been turned off and I've upgrade to the latest BIOS (V3.5). I tried unplugging
-
How To Use iCal To It's Full Potential?
I've had iCal on my Macbook since I bought it 9 months ago and have used iCal on a moderate basis. It's only been moderate because it never really hooked me to organizing my life within it. Usually I just use a pen and paper to jot down my priorities
-
Class instance vs. class name in filter params
I wonder if using a Class type in parameters of the ClassFilter, MethodFilter and FieldFilter is actually make sense. Let's say we have globally deployed aspect on a pointcut pointing to some library, deployed multiple times withing several web appli
-
When i answer a call the person on the other side can hear me but i cant hear them unless i put the loudspeaker on. So how can i resolve this
-
I need to author DVD for both ntsc, pal,& different regions.Need some help
Hey guys I have a school project in relation with a company. We have to create many DVDs for there training courses. They train dogs and they need us to edit the video footage and author the dvds READY FOR SALE. First off. I don't know at this moment