How to transpose the passes in the rows?
Hi team,
I have an obligation to transpose column on lines like the one below, I don't get the logic on how to do it,
If anyof you have encountered this logic, kindly help me.. :))
Existing table:
A | B | C | D |
---|---|---|---|
1 | 2 | 3 | 4 |
Hypothetical table:
Column | Value |
---|---|
A | 1 |
B | 2 |
C | 3 |
D | 4 |
Hello
create table tab (a number, b number, number c number d);
Insert tab
(A, B, C, D)
Values
(1, 2, 3, 4);
COMMIT;
Select label "Column", a value of tab unpivot (one label in a, b, c, d);
Tags: Database
Similar Questions
-
How to transpose the rows in multiple columns by using PivotTable
I have 1 line containing 12 columns with the value "JAN", "FEB", "MAR", "J-1","F-1","M-1","J-2","F-2","M-2","J-3","F-3","M-3"
I want to display like
JAN J - 1 F - 1 M - 1
FEB J - 2 F - 2 M - 2
MAR F - 3 J - 3 M - 3
How to achieve the foregoing?Today, you have only 3 months JAN, Feb, Mar. Is it always the same number of columns. What happens if several months ago we added this line?
Your data is really coming from relational source or some sort of text file?
There is a better way to do this in narrative using HTML mode, if your condition is just to show them in several lines and do some math.
Go to Narrative display;
In the prefix, use
In the text box 'Story' add something like that
@1 @4 @7
@2 @5 @8
@3 @6 @9 As a suffix, use
You can also add simple calculations like sum etc at the bottom of these lines as the overall totals.
Kris
-
How to change the row height in tableLayoutManager?
HIII all,.
I used TableLayoutManager in my application but don't know how to increase the row height.
I use this reference for the TableLayoutManager link.
How - to create a presentation of the rich UI at TableLayoutManager
Article number: DB-00783and I want to make the size of the entire line 68 px...
any body can help me how to change the RowHeight in tableFieldManager?
@peter
Thank you Peter for your answer.
I solved the problem as you indicate in the Tablelayoutmanager.java change before 5 months.
I asked you our post reply you as soon as possible...
I don't care
Thank you.
regaurds,
Albert_anks
-
How to limit the rows returned from the user role-based interactive reports
Hello
I'm a new Apex-PL/SQL Developer, looking for some recommendations on how to implement an interactive report to display different lines in your current application ROLE service.
For example let's say you have an application for orders and 2 different roles: superuser and sales-rep
Now, if super user connects to the application, it should be able to see all the rows in the orders table, however, if the user 'john' connects with the commercial list, he should see those orders assigned to him.
I don't think I can use "dynamic" sql and build my where clause on the fly if I choose an interactive report so I was looking around and came across the concept of a common function but it seems that some other people do this with collections of the APEX. Is there anyone with a recommendation for one to use? A few books I've read recommend putting most of the logic that you can on your database (easier to maintain in the long term) that's why I thought about pipep functions using, but I thought I would check with the experts first.
Thank you!If you are allowed to use an Enterprise Edition database and to apply these restrictions, through the entire application, or across multiple applications, then use of private virtual database (DPV), with the security attributes of PL/SQL Code to the initialization/cleanup APEX application to set and reset the settings in your application.
Should you not use EE, then you can roll your own VPD use parameterized views.
If the restriction is only required for this unique IR, then, simply use a union of two mutually exclusive predicates opportunities:
select ... from orders su where :app_role = 'super-user' union all select ... from orders rep where :app_role = 'sales-rep' and rep.salesman = :app_user
All of these approaches should outperform functions in pipeline, collections, or a user-defined function (which, in a predicate that is executed for each line, mudra stopped the large datasets because of context switching).
-
How to access the rows in table via the script
I have a numeric field floating in a table that is populated by a database. When the previewed image uses an example of XML file. The path to the field is:
topmostSubform.Page.Content.Repeater.Table1.Row1.F11a
Who got by copying the path of the script window. I have a numeric field which I hope to get the total in one day, but for debugging purposes, in the case of calculating I used the following:
var row = topmostSubform.Page.Content.Repeater.Table1.Row1;
Row.All.Length;This option displays 28 which is the correct number of lines on the page. An attempt to summarize all areas of F11a, I tried the following:
var row = topmostSubform.Page.Content.Repeater.Table1.Row1;
var sum = 0;
for (var j = 0; j < row.all.length; j ++) sum line += [j]. F11a.RawValue;
sum;I don't get anything with it. There is probably a script error. Could someone tell me what to do. Thank you
Weird, I answered this afternoon, but my answer does not seem to exist!
Search help to the title of 'Calculation of the amounts of the fields', there are examples of Javascript of the calculation of the amounts to the breast of repeating subforms which is what are the rows of the table.
If you use Formcalc is easy enough to do with wildcards. In the search help for "execute calculations from a table" and there is a picture that shows how to use wildcards for the calculation in the tables. Basically, it's in the sense of "sum" (Table.Row [*]. Field [*])
So in your case might run the following:
sum (topmostSubform.Page.Content.Repeater.Table1.Row1[*].F11a[*])
-
How to transpose the query with the following result
Dear all,
Can someone tell me a method to convert my query result
Details are provided in
http://obiee11ge.blogspot.com/2010/07/how-to-transpose-query-with-following.html
Concerning
MustafaHello
Try this
Create a request combined with,criterion no. 1: model, revenue (Actual), Cogs (Actual), Opex (Actual), PL (Actual)
in the dummy column fx enter the "Real" value
criterion 2: model, revenue (Yago), Cogs (YAgo), Opex (Yago), PL (Yago)
in the dummy column fx enter the value as "Yago".
criterion 3: model, revenue (Budget), Cogs (Budget), Opex (Budget), PL (Budget)
in the dummy column fx enter the value as 'Budget '.
Now go to the columns of result and set names coumn (revenue, COGS, Opex, PL) for the result set.
For the Dumny, remove column header.In a sheet view, you will get the result.
Thank you
Vino -
How to change the rows and columns of newtabs?
I can't change the rows and columns to mozilla version 33
From topic: config browser.newtabpage.columns shows 5 by default, but these 5 columns appear not only 3 as before. Don't know why, but I use generally not even the default new tab page in my profile daily.
Still works this - https://addons.mozilla.org/en-US/firefox/addon/new-tab-tools/ - extension to change the page of newTab via a user accessible interface name in the Addons, rather than routing autour Manager inside Firefox. I use this add-on in a second profile that I use for my favorite sites
-
How to sort the rows according to the contents in cells
Hello
Is it possible to use a formula to sort the rows according to their cell contents? I will include a screenshot of my table. What I want to do is group together people based on where they live. I wish that all rows with an 'x' in a certain State of group. Who is? Thank you!
Nevemind, I thought about it.
-
How to adapt the rows in the table spans several pages in proportion to an image?
Hi all
I have a fairly large excel file (more than 2000 lines) imported, and the resulting table spans more than 150 pages.
The problem is that the lines don't always fill the height of the text block (height of 9.5 ") on every page.
I don't like that the lines are of different sizes. I want just the lower edges of tables on each page to be in the same place.
By dragging the line down with the SHIFT key does not work if the table spans several pages/text blocks.
Is it possible to force the selected lines (or stored in a block of text) proportionally fill their block of text?
It is really not any function automatic adjustment that apply at the height of the row in the table directly, then I suspect that you're not going to find a way to do this is automatic.
If it was my document, I would consider (something like) do this:
Find the highest line in the table. (Or, perhaps that if there is some exceptionally high lines; unobtrusively manipulate them and use the 2nd or 3rd highest line as a reference.) Calculate the number of lines (max number of) of this size will fit in each text block. Divide the height of the block of text by this number to get a line height that adapts the same number of lines in each image. Then, select the entire table and all rows from this height. Follow up with the typographic settings that help uniform line height look resolutely.
-
How to join two tables if you transpose the rows, columns and rows in one of the table
Hi guys,.
can someone help me please in the write request
I have two tables
Agents and Agent phones but in the agent phones table for the id of an agent it displays 4 rows because one of the column there types of different phones (office, mobile, home, fax)
So instead of display 4 rows, I used max(case...) to convert rows to columns
now how to reach it with another table
Requirement:
Database: 11.2.0.2.0
create the table AGENT_PHONE
(
agent_id NUMBER (20) not null,
agent_type_code VARCHAR2 (10) not null,
agent_type_prefix VARCHAR2 (10) not null,
Phone_Number VARCHAR2 (16) not null,
phone_type_code VARCHAR2 (10) not null
)
CREATE TABLEAGENTS
(
agent_id NUMBER (20) not null,
agent_type_code VARCHAR2 (10) not null,
agent_type_prefix VARCHAR2 (10) not null,
NAME VARCHAR2 (40) NOT NULL
)
INSERT INTO AGENT_PHONE(AGENT_ID,AGENT_TYPE_CODE,AGENT_TYPE_PREFIX,PHONE_NUMBER,PHONE_TYPE_CODE)
VALUES (29709, ARE ', 'OFFICE', '4805551436', 'CELL');
INSERT INTO AGENT_PHONE(AGENT_ID,AGENT_TYPE_CODE,AGENT_TYPE_PREFIX,PHONE_NUMBER,PHONE_TYPE_CODE)
VALUES (29709, ARE ', 'OFFICE', '1111111111', 'PHONE');
INSERT INTO AGENT_PHONE(AGENT_ID,AGENT_TYPE_CODE,AGENT_TYPE_PREFIX,PHONE_NUMBER,PHONE_TYPE_CODE)
VALUES (29709, ARE ', 'OFFICE', '2223334444',' OFF');
INSERT INTO AGENT_PHONE(AGENT_ID,AGENT_TYPE_CODE,AGENT_TYPE_PREFIX,PHONE_NUMBER,PHONE_TYPE_CODE)
VALUES (29709, ARE ', 'OFFICE', '5556667788', 'FAX');
INSERT INTO VALUES AGENTS
(29709, ARE ', 'OFFICE', 'FLY');
INSERT INTO VALUES AGENTS
(1234, ARE ', 'OFFICE', 'MIKE');
SELECT * FROM AGENT_PHONES
AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX PHONE_NUMBER PHONE_TYPE_CODE ---------------------------------------------------------------------------------------------
29709 RE OFFICE 4805551436 CELL 29709 RE OFFICE 1111111111 PHONE 29709 RE OFFICE 2223334444 OFF 29709 RE OFFICE 5556667788 FAX
SELECT * AGENTS
AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX NAME
29709 RE OFFICE ROB 1234 RE OFFICE MIKE
This is so the data we have in both table
Now, I transposed rows to columns in the table of agent phones so I used the following query
SELECT AP. AGENT_ID,. AGENT_TYPE_CODE,. AGENT_TYPE_PREFIX.
MAX (CASE WHEN AP. PHONE_TYPE_CODE = 'CELL' THEN AP. PHONE_NUMBER END) AS CELL.
MAX (CASE WHEN AP. PHONE_TYPE_CODE = 'OFF' THEN AP PHONE_NUMBER END) AS TURNED OFF.
MAX (CASE WHEN AP. PHONE_TYPE_CODE = 'FAX' THEN AP. PHONE_NUMBER END) LIKE FAX,.
MAX (CASE WHEN PHONE_TYPE_CODE = 'PHONE'. THEN AP PHONE_NUMBER END) AS PHONE
AGENT_PHONE AP
WHERE AP. AGENT_ID = 29709
GROUP OF AP. AGENT_ID, AP. AGENT_TYPE_CODE, AP. AGENT_TYPE_PREFIX.
AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX CELL OFF FAX PHONE 1 29709 RE OFFICE 4805551436 2223334444 5556667788 1111111111 My question is how this to join the agents table so that my output should be like this...
I want to display all the results in the table of the Agent, even if they are not in the table of agent phones. As you can see there are other agent id 1234 is also populated
AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX NAME AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX CELL PHONE OFF FAX --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
29709 RE OFFICE ROB 29709 RE OFFICE 4805551436 1111111111 2223334444 5556667788 1234 RE OFFICE MIKE Currently, I run this query and I get the output as below
SELECT *.
AGENTS HAS
LEFT OUTER JOIN AGENT_PHONE AP
ON A.AGENT_ID = AP. AGENT_ID
AND A.AGENT_TYPE_CODE = AGENT_TYPE_CODE.
AND A.AGENT_TYPE_PREFIX = AGENT_TYPE_PREFIX.
AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX NAME AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX PHONE_NUMBER PHONE_TYPE_CODE 1 29709 RE OFFICE ROB 29709 RE OFFICE 4805551436 CELL 2 29709 RE OFFICE ROB 29709 RE OFFICE 1111111111 PHONE 3 29709 RE OFFICE ROB 29709 RE OFFICE 2223334444 OFF 4 29709 RE OFFICE ROB 29709 RE OFFICE 5556667788 FAX 5 1234 RE OFFICE MIKE I want id 29709 agent in a line with 1234 agent also id to display
You can rotate your phone number of agent in columns
Select *.
of AGENT_PHONE
pivot)
min (PHONE_NUMBER)
for PHONE_TYPE_CODE in ('CELL' as a 'CELL', 'PHONE' like 'PHONE', 'OFF' in the 'OFF', 'FAX' as 'FAX')
)
AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX CELL PHONE OFF FAX 29709 RE OFFICE 4805551436 1111111111 2223334444 5556667788 Then you can join to view inline or CTE
with AGENT_PHONE_PIVOT like)
Select *.
of AGENT_PHONE
pivot)
min (PHONE_NUMBER)
for PHONE_TYPE_CODE in ('CELL' as a 'CELL', 'PHONE' like 'PHONE', 'OFF' in the 'OFF', 'FAX' as 'FAX')
)
)
SELECT *.
AGENTS HAS
LEFT OUTER JOIN AGENT_PHONE_PIVOT AP
ON A.AGENT_ID = AP. AGENT_ID
AND A.AGENT_TYPE_CODE = AGENT_TYPE_CODE.
AND A.AGENT_TYPE_PREFIX = AGENT_TYPE_PREFIX.
AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX NAME AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX CELL PHONE OFF FAX 29709 RE OFFICE ROB 29709 RE OFFICE 4805551436 1111111111 2223334444 5556667788 1234 RE OFFICE MIKE - - - - - - - Is that what you're looking for?
-
How increase automatically the rows in a table
Dear friends,
In apex 4.1 I don't see Adding line in the process due to which i m unable to increase the lines in a table automatically when you click on the button to add a line. Can u please help me in this regard how improve rows in apex 4.1?
Concerning
KamranHi Keita,
To do this, you must create a separate process for the tabular presentation.
Please check that you remove it
javascript.addRow () in the box add row button and change to submit the page.
Create a process page, select form---> Data Manipulation---> add lines of tabular presentation---> give the necessary lines as you wish (5).
Brgds,
Mini----------------------
Mark responds promptly -
How to disable the rows in table
Hello
I have create a vo.
vo returns 8 rows,
There is table area.
Thanks to this region, all lines are displayed.
but my doubt is.
I want to disable 2 rows in the tabloe region.
How can I turn off the lines in the table.
Thank youHello
It will work for messageTextinputs!
Gerard
-
How to delete the row in the table of construction?
I'm trying to choose whether to add the new values in the table or clear the table, but I think I have a mistake. The error is that the polymorphic terminal cannot accept this type of data.
Does anyone know what I could do wrong?
There is a built-in function that is already called point by point average. It's on the range tool. You can tell him how many points on average then they come in one at a time.
-
Transpose the row of columns inside a FOR LOOP
Hi all
I'm on 11g R1 and I have 2 tables
In a PL/SQL block, I have the cursorselect * from table1; PRODUCTNO PRODUCT_NAME STATUS -------------- -------------------- -------- 1 TV 5 2 CAR 5 3 COMPUTER 5 4 Accessories 5 select * from table2; PRODUCTNONO PART_NAME --------------------- -------------------- 1 ANTENNA 1 CABLE 2 BRAKES 2 TYRES 2 SPARK PLUGS 3 MONITOR 4 PRINTER 4 KEYBOARD 5 MOUSE
a l_col collection that stores the values of part_name little, something likecursor cur_1 (P_name varchar2) is select a.productno,a.product_name,a.status, b.part_name From table1 a, table2 b Where a.productno = b.productno and b.part_name = P_name;
ANTENNA
CABLE,
BRAKES,
TIRES,
SPARK PLUGS,
MONITOR
I now have in the pl/sql block
and the dbms_output isfor j in 1 .. l_col.count loop For L_Carq In cur_1 (L_col(j).part_name) Loop Dbms_Output.Put_Line(L_carq.productno || ' | ' || L_carq.product_name || ' | ' || L_carq.part_name || ' | ' || L_carq.status); Dbms_Output.Put_Line('-----------------------------------------------------------------------------------------------------------------------------------'); --/* Update table1 set status = 0 Where productno = (l_carq.productno ); Commit; --*/ End Loop;
You have an idea how I can get the dbms_output asPRODUCTNO PRODUCT_NAME PART_NAME STATUS ------------------ ---------------- ----------------- ------------ 1 TV ANTENNA 5 1 TV CABLE 5 2 CAR BRAKES 5 2 CAR TYRES 5 2 CAR SPARK PLUGS 5 3 COMPUTER MONITOR 5
On SQL, I could format the output very easy, but unfortunately I'm forced to use the loop for.PRODUCTNO PRODUCT_NAME PART_NAME STATUS ------------------ ----------------------- ------------------- ---------- 1 TV ANTENNA,CABLE 5 2 CAR BRAKES,TYRES,SPARK PLUGS 5 3 COMPUTER MONITOR 5
Any help is appreciated.
Thank you
DaniThe collection must be extended "manually":
-- initializing with the default constructor (you can do it in the declaration section) : l_col := sys.odcivarchar2list(); For K In D Loop l_col.extend; l_col(l_col.last) := k.part_name; End Loop;
I can't specify each part_name in where clause
Where do you source?
If there is another table, you can use BULK COLLECT, but maybe I don't see the whole picture here?Published by: odie_63 on August 2, 2010 16:45
-
How to access the rows in a table
Hi Experts,
I am a newbie to Oracle Forms. I use a tabular form that has 5 lines. I have an Insert button and clicking on it, I have to insert all the lines in the form of database. My question is how can I access 2nd, 3rd and other lines of tables inside my PL/SQL block.
Look forward to hearing from you soon.
Thank youHello and welcome to the forum,
If I understand, you have non-database block in your form and insert the record-by-record button. If the above code is fine but slight change just use the built-in function NEXT_RECORD inside the loop, otherwise it will get stuck on the first record as...LOOP ... EXIT WIEH ... NEXT_RECORD; -- Just add this built-in to move cursor to the next record in tabular block. END LOOP;
-Clément
Maybe you are looking for
-
Re: What should I do for Satellite A200 PSAE3 of Vista downgrade to XP
Hello I need do downgrade from Vista to XP Satellite A200 (PSAE3). Is this crazy? And what drivers for the comnents?
-
Compatibility iPod Classic/El Capitan
Hi guys! I'm about to upgrade my Mac OS X to the new El Capitan (it's a Mac 2012 environment). However I'm wondering if I can use my iPod Classic 80 GB (bought in 2008, do not know the sorry generation!) with him, smoothly and without problem as I do
-
Hi, I'm using TDMS format for my project. I succedd to connect all the data into TDMS files using the DAQmxConfigureLogging(taskHandle, logFile.toAscii().constData() ,DAQmx_Val_LogAndRead,"GroupName",DAQmx_Val_OpenOrCreate) Now my problem is that whe
-
Display properties wallpaper troubleshooting
Right click, click Properties... click Desktop... CAN NOT CHANGE of PHOTO... my options are "grayed out"... the only thing I'm allowed to change is the background color... can't change background or position... simply, it leaves no suggestions myself
-
I think MS Store I buy Windows 8.0 first, then the upgrade (free) from here. In fact, it would be a drive replacement (not a download was updated on my desk). Responded. * QUESTION UNANSWERED, MUST HOWEVER HOW DO I UNINSTALL WINDOWS XP PRO? (&). * I