Combine multiple lines in a single line
Hello
I want the output of several data of line in a row.
I try to display the supervisor of people and their supervisors and so on. I am able to display the Level1 supervisor and not able to display the next level.
Here is the code:
with
Nobody like
(select person_id 100299, employee_name 'VELASCO, OMAR' Union double all the)
58293, select "UREÑA, PABLO" Union double all the
Select 98539, 'USLENGHI, MATIAS slimani' Union double all the
Select 68240, "Slimani, Mr. Vrishal A" Union double all the
Select 72230, 'Harvey, Mr. Darin S' Union double all the
Select 76200, 'CLARK, TIM MIDDLE EAST' of all the double union
Select 67819, "BOEHLER, JEFF a." everything double union
29202, select "FRADIN, ROGER" the double
),
master_slave as
(select 100299 slave, master 58293 Union double all the)
Select 58293,98539 from all the double union
Select 98539,68240 from all the double union
Select 68240,72230 from all the double union
Select 72230,76200 from all the double union
Select 76200,67819 from all the double union
Select 67819,29202 from all the double union
Select 29202, the double null
),
hierarchy as
(select level lvl, sys_connect_by_path(slave,'|') path, max (level) on max_level)
of master_slave
where connect_by_isleaf = 1
connect by slave = master prior
),
Splitter (LVL, person_id, supervisor_1, supervisor_2, path) as
(select lvl,
regexp_substr (path '(\ |) [ ^|] +)', 1, 1, null, 1).
regexp_substr (path '(\ |) [ ^|] +)', 1, 2, null, 1).
regexp_substr (path '(\ |) [ ^|] +)', 1, 3, null, 1).
regexp_replace (path,'^-|) [ ^|] +')
of the hierarchy
where lvl = max_level
Union of all the
Select lvl,
regexp_substr (path '(\ |) [ ^|] +)', 1, 1, null, 1).
regexp_substr (path '(\ |) [ ^|] +)', 1, 2, null, 1).
regexp_substr (path '(\ |) [ ^|] +)', 1, 3, null, 1).
regexp_replace (path,'^-|) [ ^|] +')
between the separator
where path is not null
)
Select person_id, to_number (ltrim(s.person_id,'|')),
(select employee_name from person where person_id = to_number (ltrim(s.person_id,'|'))) employee_name,
(select employee_name from person where person_id = to_number (ltrim(s.supervisor_1,'|'))) supervisor_1,
(select employee_name from person where person_id = to_number (ltrim(s.supervisor_2,'|'))) supervisor_2
s separator
where s.person_id is not null
order by length (s.path) desc nulls last
PERSON_ID | Employee_name | SUPERVISOR_1 | SUPERVISOR_2 |
---|---|---|---|
100299 | VELASCO, OMAR | UREÑA, PABLO | USLENGHI, MATIAS slimani |
58293 | UREÑA, PABLO | USLENGHI, MATIAS slimani | Slimani, Mr. Vrishal A |
98539 | USLENGHI, MATIAS slimani | Slimani, Mr. Vrishal A | Harvey, Mr. Darin S |
68240 | Slimani, Mr. Vrishal A | Harvey, Mr. Darin S | CLARK, TIM MIDDLE EAST |
72230 | Harvey, Mr. Darin S | CLARK, TIM MIDDLE EAST | BOEHLER, JEFF HAS |
76200 | CLARK, TIM MIDDLE EAST | BOEHLER, JEFF HAS | FRADIN, ROGER |
67819 | BOEHLER, JEFF HAS | FRADIN, ROGER | - |
29202 | FRADIN, ROGER | - | - |
Concerning
Adrien
Tags: Database
Similar Questions
-
Combine multiple lines into one line (from two tables / result sets)
Hello experts,
I would like to know how to combine multiple lines/records in a single record. Here are the DDL and DML to tables:
create table test_table)
client_name varchar2 (50 char),
login_time timestamp (6).
logout_time timestamp (6).
auto_type varchar2 (10 char)
)
create table root_table)
navigation_time timestamp (6).
client_name varchar2 (50 char),
VARCHAR2 (50 char) nom_du_groupe
)
Insert into test_table
values ("John", TO_TIMESTAMP ('2013-12-05 17:04:01.512 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), TO_TIMESTAMP ('2013-12-05 17:27:31.308 ',' YYYY-MM-DD HH24:MI:SS.) FF'), 'SIMPLE');
Insert into test_table
values ('David', TO_TIMESTAMP ('2013-12-05 06:33:01.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), TO_TIMESTAMP ('2013-12-05 06:45:01.112 ',' YYYY-MM-DD HH24:MI:SS.) FF'), 'SIMPLE');
insert into root_table
values (TO_TIMESTAMP ('2013-12-05 17:04:01.512 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "invalid");
insert into root_table
values (TO_TIMESTAMP ('2013-12-05 17:14:22.333 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "GROUP_1");
insert into root_table
values (TO_TIMESTAMP ('2013-12-05 17:27:31.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "GROUP_1");
insert into root_table
values (TO_TIMESTAMP ('2013-12-05 06:33:01.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), "David", "invalid");
insert into root_table
values (TO_TIMESTAMP ('2013-12-05 06:45:01.112 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'David', 'GROUP_5');
game results test_table
client_name login_time logout_time auto_type John 05/12/2013 5:04:01.512000 PM 05/12/2013 5:27:31.308000 PM SIMPLE David 05/12/2013 6:33:01.308000 AM 05/12/2013 6:45:01.112000 AM SIMPLE root_table result set
navigation_time client_name GroupName 05/12/2013 5:04:01.512000 PM John Not valid 05/12/2013 5:14:22.333000 PM John GROUP_1 05/12/2013 5:27:31.308000 PM John GROUP_1 05/12/2013 6:33:01.308000 AM David Not valid 05/12/2013 6:45:01.112000 AM David GROUP_5 And here is the SQL code I'm writing:
Select a.customer_name, a.login_time, a.logout_time, a.auto_type, Max (b.group_name)
from test_table a, b root_table
where a.customer_name = b.customer_name
Group of a.customer_name, a.login_time, a.logout_time, a.auto_type
As the 'invalid' value is greater than the value "GROUP_1" (based on the number of letter in English), the GroupName is returned as 'invalid '. I want to bring the GroupName based on the navigation_time column in the root_table so that it always returns a valid GroupName. Please help me.
Output current:
Client_name. Login_Time. Logout_Time | Auto_Type | GroupName
--------------------------------------------------------------------------------------------------------------------------------------------
John | 05/12/2013 5:04:01.512000 PM | 05/12/2013 5:27:31.308000 PM | SIMPLE | Not valid
David | 05/12/2013 6:33:01.308000 AM | 05/12/2013 6:45:01.112000 AM | SIMPLE | Not valid
Expected results:
Client_name. Login_Time. Logout_Time | Auto_Type | GroupName
--------------------------------------------------------------------------------------------------------------------------------------------
John | 05/12/2013 5:04:01.512000 PM | 05/12/2013 5:27:31.308000 PM | SIMPLE | GROUP_1
David | 05/12/2013 6:33:01.308000 AM | 05/12/2013 6:45:01.112000 AM | SIMPLE | GROUP_5
Thank you!
Adding INSERT statements, current and planned outputs.
This...
SELECT client_name
login_time,
logout_time,
auto_type,
GroupName
Of
(select a.customer_name,
a.login_time,
a.logout_time,
a.auto_type,
b.group_name,
ROW_NUMBER() over (PARTITION BY a.customer_name, a.login_time, a.logout_time, a.auto_type ORDER BY b.group_name) rn
from test_table a, b root_table
where a.customer_name = b.customer_name)
WHERE rn = 1;
OUTPUT:-
=========
David DECEMBER 5, 13 06.33.01.308000000 AM DECEMBER 5, 13 06.45.01.112000000 AM SIMPLE GROUP_5 John DECEMBER 5, 13 05.04.01.512000000 PM DECEMBER 5, 13 05.27.31.308000000 PM SIMPLE GROUP_1 Thank you
Ann
-
I don't seem to be able to combine multiple adobe files into a single adobe document. Do I need to buy an additional product for this in adobe reader?
Hi Art Brock,
You can buy the Adobe PDF package to combine the files using Adobe Reader, if you must use Acrobat Reader DC for this task.
You can purchase the subscription by using the following link: online PDF converter, convert to web or Acrobat Reader | Adobe PDF Pack
Kind regards
Rahul -
combine multiple files into a single
Hi all
Request:
1. the need to combine several files into a single
2. the user already created destination doc
3 folder contains about 30 files (all files having 1 page only)
4. the need for a
Script:
1. to receive the forum script (combine multiple documents)
2. using the forum script, the output comes wrongly (comes side by side)
Fault output using the script below:
Power required:
Slightly modified:
#target indesign // set the destination document as the active document. var destination_doc = app.activeDocument; destination_doc.documentPreferences.allowPageShuffle = true; destination_doc.spreads[-1].allowPageShuffle = true; // select the source folder var sourceFolder = Folder.selectDialog("Select a folder with source InDesign files."); var fileList = sourceFolder.getFiles(); fileList.sort(); for ( var i = 0; i < fileList.length; i++ ) { var source_file = fileList[i]; if ( source_file instanceof File && source_file.name.match(/\.indd$/i)) { app.open(source_file); var source_doc = app.open(source_file); var sourcePages = app.activeDocument.pages.item(0); sourcePages.duplicate(LocationOptions.AFTER, source_doc.pages.item(0)); sourcePages.move(LocationOptions.AFTER, destination_doc.pages.item(-1)); app.activeDocument.close(SaveOptions.NO); } }
Thanks in advance
Siraj
Hello
You should duplicate/move a spread instead of a page.
Try simply change around L18 - 20 as below.
var source_doc = app.open(source_file); var sourceSpreads = app.activeDocument.spreads.item(0); sourceSpreads.duplicate(LocationOptions.AFTER, source_doc.spreads.item(0)); sourceSpreads.move(LocationOptions.AFTER, destination_doc.spreads.item(-1)); app.activeDocument.close(SaveOptions.NO);
Thank you
-
Click on the link that executes JavaScript to combine multiple PDFs into a single pdf file
I provide a USB that contains about 4 GB of various PDF files in different folders. I would like to have a link/button in a particular PDF file that would combine several PDF files to another folder in a single PDF file to view or print. This USB key will be used on Mac and PC. Users will be responsible also for all of files on a tablet or iPad to take meetings. I am able to do this if I know the absolute path to the files, but not when the path is a parent. Did anyone done this before? Suggestions?
Thank you.
It is impossible in the drive.
-
Combine multiple statements into a single merge?
Hi all
I'm stuck with a situation here that I've ever met. I will try to describe below. I'm running it in Oracle 10 g.
TABLE_A is empty before the start of the process. TABLE_B has a few million lines. Rest a few thousand.
INSERT the TABLE_A
SELECT * FROM TABLE_B;
MERGE the TABLE_A
With the HELP of TABLE_C
ON TABLE_A.PID = TABLE_C.PID
WHEN MATCHED
UPDATE
WHEN NOT MATCHED
INSERT;
MERGE the TABLE_A
With the HELP of TABLE_D
ON TABLE_A.PID = TABLE_D.PID
WHEN MATCHED
UPDATE
WHEN NOT MATCHED
INSERT;
MERGE the TABLE_A
With the HELP of TABLE_E
ON TABLE_A.PID = TABLE_E.PID
WHEN MATCHED
UPDATE
WHEN NOT MATCHED
INSERT;
due to the huge amount of data, the merge statement has faced every time that it runs, it consumes a lot of time (hours) to run. Is it possible to rewrite above fusion sql in a sql statement using outer joins? I tried a few approaches, but none seems to be practical. Please shed some light on the question, if you find a way more right to do the same thing.
Thank you
Without any code and actual tables, all I can do is to guess:
Fusion in table_a a
using (select... table_c
Union of all the
Choose option... table_d
Union of all the
Choose option... table_e
) u
on (u.pid = a.pid)
When matched...
When not matched...
But I don't know if there are keys duplicated on other tables. If there is, you will get the unstable set of lines error.
-
Why combine multiple PDFs into a single pdf stop working?
Why would "Combining pages into a single pdf document" just stop working?
He worked two days ago.
Now does not open the window of combine on OSX 10.9.5
With the help of Acrobal pro VI
It does not freeze and the other elements work always.
The "Handset" command simply has nothing.
I uninstalled the program and reinstalled.
Acrobat Pro VI
No change. Still, the cartel control does not.
I have tried on several different .pdfs and also from the main menu.
What is confusing is that it worked a few days earlier.
-
Combining multiple layers into a single
Hey guys,.
hope its pretty clear in the title, working on a project and I have several layers that I would like to convert in a single layer. I hope the screenshot helps.
Precompose them.
-
InDesign CS5 - combine multiple files into a single
I use InDesign CS5.
My question is how can I combine several documents into one?
I want to create a new document. I then want to choose a bunch of documents to a folder. So I want the selected statement placed at the end of the original document one by one until all selected documents have been placed.
From the GUI, I understand it is the goal of available > > Pages > > Pages to move. How could I do with a script?
http://indisnip.WordPress.com/2010/08/09/moveduplicate-pages-between-documents/
-
Convert a single column into multiple lines
Hi people,
I have a task to display a single column into multiple lines (for use in LOV)
For Ex:
The column consistes of value such as 98,78,67,68,34,90. -It's a unique column values where none of the values can be ' number that is separated by commas
Then we must view it as
98
78
67
68
34
90
-under the number of lines (no lines can be ' do not number).
Thanks in advanceTry this...
SQL> ed Wrote file afiedt.buf 1 select regexp_substr('98,78,67,68,34,90', '[^,]+',1,level) Value 2 from dual 3* connect by level <= regexp_count('98,78,67,68,34,90',',') + 1 SQL> / VALUE ----------------- 98 78 67 68 34 90 6 rows selected.
Thank you!
-
How to insert multiple lines using a single query
Hi all
How to insert multiple lines using a single query to the emp table?
I have the number of rows to insert into table x. consumes a lot of time. I tried to insert several lines using a single query, but get errors. I know exactly the query to do this.
Thank you
SunilLike this?
SQL> create table test(id number , dt date); Table created. SQL> insert into test values(&a,&b); Enter value for a: 1 --- It asked me and I entered 1 Enter value for b: sysdate --- It asked me and I entered sysdate old 1: insert into test values(&a,&b) new 1: insert into test values(1,sysdate) 1 row created. SQL>
g.
-
Convert multiple lines in a single value separated by commas
Is is possible to convert multiple lines in a single value by concatenating the value of each line in OBIEE. I think that IO had seem a blog related to this by I'm not able to find him. Essentially, here's what I would do:
Number of customer location
101
101 NY
101 PA
102 TX
102 CA
This is to convert
101. HE, NY, PA
102 TX, CA
Can you get it someone please let me know if this is possible and how to operate it.
Thanks in advance for the help.You can do this by creating a DB function,
Visit this link
Re: Display of the horizontal valuesThank you
Vino -
Data in multiple lines concatenated into a single line to separate id
Hello
I have a t1 like this table:
create table t1
(number of c1,
number of C2,
C3 number (4.2)
);
Data in the table are such as:
----------------------------------------
C1 | C2 | C3 |
-----------------------------------------
102. 1. 1.1 |
102. 1. 1.2 |
102. 2. 2.1 |
103. 2. 2.1 |
103. 2. 2.2 |
-----------------------------------------
How to display data by using a query above?
------------------------------------------------------
C1 | C2 | C3 |
-------------------------------------------------------
102. 1, 2 | 1.1, 1.2, 2.1 |
103. 2. 2.1, 2.2.
------------------------------------------------------
Thank youSo you're after what we call 'Aggregation in the chain.'
Check this link as it highlights several techniques:
Aggregation of string techniques
A Re: Concat ranks of the values in a single column Michael
At Re: multiple lines in a single line in the 'single column Table' followed by reason of Billy on the conduct of a stragg first.
In addition, 11 GR 2 has the LISTAGG function.
-
Arrange the tiles in a column, but multiple lines
When you have the tiles on The start screen of Metro , you can set the group / block a tile only, but when you want to add the second tile to this group / block, you can put only horizontally (from left or right tile existed), in other words, you can add the column within that group, but you can put the new Tile vertically , under a tile already existence.
I want to define group / block of tiles with a single column, but multiple lines.For example, instead of this:xx xx xx xxxx xx xxto get this:xx x xx xxxx x xx xxScreenshot:Hi Mike b. II.
It's normal. You cannot have tiles in groups vertically. Now in your case, if you change the tiles to large tiles, they will stack vertically.
-
Frame content with multiple lines of text
Hello
In Indesign CS5 (Mac) is possible to get the same behavior as 'To adapt to the content Frame' pieces on a single line of text, to work with multiple lines?
In other words, to adapt the framework to the height AND width of the text.
We have black text and the text block has a fill and a stroke. What we are trying to achieve is to be able to quickly and accurately, resize it framework for however many lines it takes place in. By using the default behavior, so that we can use "mount the frame to the content" to get the height, but we need to manually drag the width.
Thank you
Try this (CS4/CS5):
// Your Settings: var X_PRECISION = .1; // pts // Some constants var INNER = CoordinateSpaces.INNER_COORDINATES, MULTIPLY = ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY, ADDTO = ResizeMethods.ADDING_CURRENT_DIMENSIONS_TO, AP_LEFT = AnchorPoint.TOP_LEFT_ANCHOR, AP_RIGHT = AnchorPoint.TOP_RIGHT_ANCHOR; function fitHorizontal(/*TextFrame*/ tf, /*str*/xRef) //---------------------------------------------------------- // Fits a textframe width to its content // = adjusts the frame width to the optimal value without changing the height // xRef (opt.) is the reference pt: 'left'(default) | 'right' | 'center' // * You may invoke first tf.fit(FitOptions.FRAME_TO_CONTENT), i.e. fitVertical // * This routine supports rotated text frame // * Also, unlike the InDesign UI, this supports *multicolumn* TF //---------------------------------------------------------- { // Default width multiplier. This value is only used if // tf overflows in its initial state. 1.5 is fine, usually. var X_FACTOR = 1.5; var ovf = tf.overflows, dx; xRef = AnchorPoint['TOP_'+(xRef||'left').toUpperCase()+'_ANCHOR']; // If tf originally overflows, we need to increase the width while( tf.overflows ) tf.resize(INNER,xRef,MULTIPLY,[X_FACTOR,1]); // Now, let's compute the maximal width variation (dx) dx = tf.resolve(AP_RIGHT, INNER)[0][0]-tf.resolve(AP_LEFT, INNER)[0][0]; if( ovf ) dx *= (1-1/X_FACTOR); // Dichotomy on dx while( dx > X_PRECISION ) { dx*=.5; tf.resize(INNER,xRef,ADDTO,[dx*(tf.overflows?1:-1),0]); } // Last step, if needed if( tf.overflows ) tf.resize(INNER,xRef,ADDTO,[dx,0]); } //---------------------------------------------------------- // Sample code //---------------------------------------------------------- // Assuming the user has selected a text frame var tf = app.selection[0]; // Vertical fit (if you want it first --but not needed) tf.fit(FitOptions.FRAME_TO_CONTENT); // Horizontal fit (from the left edge) fitHorizontal(tf, 'left');
@+
Marc
Maybe you are looking for
-
Re: Toshiba Gigaframe Q81 - audio how custom as alarm
Hello guys,. I hope someone can help me. I use my photoframe as a wake-up call, but I can not set up audio as an alarm. There are two positions of the alarm settings: 'default' and 'music', but there is no difference between these two modes, the gadg
-
Upgrading a motherboard on HP Pavilion dv6 for best graphics games :)
I have a dv6 6169 - we and suck the graphics! I have about 32 or 64 MB of dedicated video RAM and 2 GB shared. I need better supported graphic to play the games I love. I don't know how to update a motherboard but only as I look for when getting a mo
-
Free applications appears do not?
Hello. I bought my Z2 in May and when buying I was told that a selection of free applications, including the Garmin Navigation system would be available for me to download as a user of the Xperia lounge Z2. I checked several times and never seen avai
-
Cannot create breakpoints in 25 px of an existing breakpoint
Not sure why I get this error message when I am clearly far another breakpoint. In addition, what happens on the pages of the child and not the master page. On the master page, I put in breakpoints easily without any problem. I wonder if someone ca
-
Control a movieclip with the position of the mouse
Hello everyone,I worked on a small project at work, I'm trying to controll a movieclip which consists of 60 still images of an aircraft (total 120 frames) that when played will show a view of 360 degrees of said aircraft. I can make it work with butt