Need output of Req
Hi, please help me solve my requirement.
My requirment is
I have a function in which I have a slider that gets the name and the parameter...
Output of this slider will be in the format below.
NAME | PARAMETER |
N1 | P1 |
N1 | P2 |
N2 | P3 |
N4 | P4 |
N5 | P6 |
N5 | P7 |
I need to come back in the service of:
N1 |
P1 |
P2 |
N2 |
P3 |
N4 |
P4 |
N5 |
P6 |
P7 |
hope you understand my requirment.
Thanks in advance
I think he struggles with "WITH".
Select case when y.rn = 1 and x.rn = 1 then nm
When y.rn = 2 then setting
otherwise null end as col
(select nm, setting, row_number() over (partition by order nm by parameter): the nurse of)
(
Select "ANTI HCV ANTIBODIES" nm, "ANTI HCV ANTIBODIES" as parameter of double union all
Select 'ANTI HCV ANTIBODIES', 'HCV-S/CO"dual union all
Select "ANTI HIV I AND II ANTIBODIES", "ANTI HIV I AND II' from dual union all
Select "ANTI HIV I AND II of ANTIBODIES", "HIV-S/CO" dual union all
Select "BLOOD GROUPING AND TYPE (ABO and Rh)', 'Blood' from dual union all
Select 'GROUPAGE BLOOD AND TYPING (ABO and Rh)', "RH factor" of all the double union
Select 'BLOOD GROUPING AND TYPE (ABO and Rh)', ' HR (D) Type:' Union double all the
Select 'BLOOD GROUPING AND TYPE (ABO and Rh)', ' group ABO:' Union double all the
Select "HBsAg", "HBsAg" dual union all
Select "HBsAg", "ANTI HCV ELISA' from dual union all
Select "ANTIBODIES IRREGULARS", "ANTIBODIES IRREGULARS" dual union all
Select "PARASITES of MALARIA", "PARASITES of MALARIA' from dual union all
Select "VDRL (QUALITATIVE) ',' (QUALITATIVE) VDRL' double '.
)
) x
cross join
(select rownum rn of the double connection by rownum<= 2)="">=>
where (y.rn = 1 and x.rn = 1) or y.rn = 2
order of x.nm, x.rn
/
Tags: Database
Similar Questions
-
How to use the commands on the cmd prompt witout using a string like 'netstat' but I need output
How use the commands on the cmd prompt witout using a string like netstat but I need output
example: C:\ > netstat-an... will give its results
But if the keyword netstat is blocked...
I want to use the command netstat another way... can I convert it to binary, and then I can run or something else
Please answer my questinNetstat is simply a file program located in the folder C:\Windows\System32. It appears as "netstat.exe. If you rename (or copy / paste / rename) to "abc.exe" then you can run it using 'abc' instead of 'netstat '.
HTH,
JW -
need output in a manner of desire
Hi Master,
I have a table with a column named names. It contains the name like this
ABC
ABC
ABC
ABC
ABC
XYZ
XYZ
XYZ
XYZ
But I want output like this
ABC
XYZ
ABC
XYZ
ABC
XYZ
Like this...!!!
Please advise...!
Concerning
SA
Hello
Somehting like
SOME names
Of a_table
ORDER BY ROW_NUMBER () (PARTITION NAMES
ORDER BY NULL
)
names
;
According to your needs.
-
Published by: H.O on March 25, 2012 11:15Hi Need Efficient Sql Query with the below type of output from table t1 FOR <set of records with unique KEY column> IF COND='THIS' THEN display <ID,NAME,KEY,COND> of row 'THIS' & <ID> of row 'MOY' ELSE display <ID,NAME,KEY,COND> of row 'MOY' END IF; _sample output_ 101,'ROY',110022,'THIS',108 201,'ROY',210022,'THIS',220 ... ... 32323,'MOY',420022,'QWR',XXX T1 (ID,NAME,KEY,COND) insert into t1 values (101,'ROY','HW:110022:12345','THIS') insert into t1 values (102,'JOY','HW:110022:23456','CFR') insert into t1 values (104,'DOY','HW:110022:09876','POT') insert into t1 values (105,'KOY','HW:110022:98765','IUR') insert into t1 values (108,'MOY','HW:110022:34345','ABC') insert into t1 values (110,'SOY','HW:110022:25752','ABC') insert into t1 values (112,'KID','HW:110022:13586','QWR') insert into t1 values (120,'WDY','HW:110022:26475','UBG') insert into t1 values (121,'EFG','HW:110022:20785','WXD') insert into t1 values (122,'POY','HW:110022:37543','QSX') insert into t1 values (201,'ROY','HW:210022:12345','THIS') insert into t1 values (202,'JOY','HW:210022:23456','CFR') insert into t1 values (204,'DOY','HW:210022:09876','POT') insert into t1 values (205,'KOY','HW:210022:98765','IUR') insert into t1 values (208,'GOY','HW:210022:34345','ABC') insert into t1 values (210,'SOY','HW:210022:25752','ABC') insert into t1 values (212,'KID','HW:210022:13586','QWR') insert into t1 values (220,'MOY','HW:210022:26475','UBG') insert into t1 values (221,'EFG','HW:210022:20785','WXD') insert into t1 values (2101,'NOY','QW:220022:12345','THIS') insert into t1 values (2102,'MOY','QW:220022:23456','CFR') insert into t1 values (2104,'FOY','QW:220022:09876','POT') insert into t1 values (2105,'LOY','QW:220022:98765','IUR') insert into t1 values (2118,'LOY','QW:220022:34345','DEF') insert into t1 values (2210,'SOY','QW:220022:25752','ABC') insert into t1 values (2223,'KID','QW:220022:13586','QWR') insert into t1 values (2233,'WDY','QW:220022:26475','UBG') insert into t1 values (2235,'EFG','QW:220022:20785','WXD') insert into t1 values (2336,'POY','QW:220022:37543','QSX') insert into t1 values (2339,'POY','QW:220022:37543','QSX') insert into t1 values (3101,'HIT','QW:320022:12345','THIS') insert into t1 values (3103,'JOY','QW:320022:23456','KOT') insert into t1 values (3106,'FOY','QW:320022:09876','POT') insert into t1 values (3107,'LOY','QW:320022:98765','IUR') insert into t1 values (3118,'MOY','QW:320022:34345','DEF') insert into t1 values (3210,'SOY','QW:320022:25752','ABC') insert into t1 values (3223,'KID','QW:320022:13586','QWR') insert into t1 values (3233,'WDY','QW:320022:26475','UBG') insert into t1 values (3235,'EFG','QW:320022:20785','WXD') insert into t1 values (3336,'POY','QW:320022:37543','QSX') insert into t1 values (3339,'POY','QW:320022:37543','QSX') insert into t1 values (32323,'MOY','QE:420022:13586','QWR') insert into t1 values (32333,'WDY','QE:420022:26475','UBG') insert into t1 values (32335,'SOY','QE:420022:20785','WXD') insert into t1 values (33336,'POY','QE:420022:37543','QSX') insert into t1 values (33339,'POY','QE:420022:37543','QSX') insert into t1 values (42323,'DEF','QW:520022:13586','QWR') insert into t1 values (42333,'WDY','QW:520022:26475','UBG') insert into t1 values (42335,'MOY','QW:520022:20785','WXD') insert into t1 values (43336,'POY','QW:520022:37543','QSX') insert into t1 values (43339,'POY','QW:520022:37543','QSX')
Sorry ill read the requirement
Edited by: Etbin on 25.3.2012 20:45
Maybe NOT TESTED!
select id,name,key,cond,id_of from (select id,name,substr(key,4,6) key,cond, case when cond = 'THIS' and lead(name) over (partition by substr(key,4,6) order by decode(cond,'THIS',1,2)) = 'MOY' then lead(id) over (partition by substr(key,4,6) order by decode(cond,'THIS',1,2)) else 'XXX' end id_of, row_number() over (partition by substr(key,4,6) order by decode(cond,'THIS',1,2)) rn from your_table where cond = 'THIS' or name = 'MOY' ) where rn = 1 order by key
Concerning
Etbin
Edited by: Etbin on 25.3.2012 20:54
-
need output to only two org_ids
Hello
I have this request with me
kindly helpselect DESCRIPTION, list_price_per_unit,segment1,segment2,segment3,PRIMARY_UOM_CODE,PRIMARY_UNIT_OF_MEASURE ,org_id from mtl_system_items where INVENTORY_ITEM_STATUS_CODE ='Active' and segment1 like '205%' or segment1 like '7%' the output is as follows DESCRIPTION LIST_PRICE_PER_UNIT SEGMENT1 SEGMENT2 SEGMENT3 PRIMARY_UOM_CODE PRIMARY_UNIT_OF_MEASURE org_id CABLE 3 X 2.5MM 2 (WHITE) 18.5 2050101108 MTR METER 103 CABLE 3 X 2.5MM 2 (WHITE) 1 2050101108 MTR METER 105 TYRE 700 R16 LT 1 7020499027 EA EACH 121 HAND TAP SET MM 13.5 2059901143 SET Set 103 HAND TAP SET MM 1 2059901143 SET Set 105 TYRE 1 7020499035 EA EACH 121 i need only the output corresponding to org_id 105 and 121 only ie as follows DESCRIPTION LIST_PRICE_PER_UNIT SEGMENT1 SEGMENT2 SEGMENT3 PRIMARY_UOM_CODE PRIMARY_UNIT_OF_MEASURE org_id CABLE 3 X 2.5MM 2 (WHITE) 1 2050101108 MTR METER 105 TYRE 700 R16 LT 1 7020499027 EA EACH 121 HAND TAP SET MM 1 2059901143 SET Set 105 TYRE 1 7020499035 EA EACH 121 i tried and organization_id LIKE'105' OR organization_id LIKE '121' but doesnt seem to work
thanking in advance
Published by: makdutakdu on 22 Sep, 2010 08:00
Published by: makdutakdu on 22 Sep, 2010 08:00
Published by: makdutakdu on 22 Sep, 2010 08:02
Published by: makdutakdu on 22 Sep, 2010 08:03
Published by: makdutakdu on 22 Sep, 2010 08:04
Published by: makdutakdu on 22 Sep, 2010 08:05
Published by: makdutakdu on 22 Sep, 2010 08:06
Published by: makdutakdu on 22 Sep, 2010 08:07Have you kept the condition locked in ()
(segment1 like '205%' or segment1 like '7%')
-
I have a requirement to display information in a table format.
It's my request... And I have to get an output like below. The query must be changed according to the output format
Select IM. Resantibiotic, IM. CreatedDate, Count (*)
of pharmacy.itemcompany ic
On ic.itemcode = b.itemcode
inner join IM IC_ANTIBIOTIC_MAPPING
on IM. ITEMCODE = ic.itemcode
where IM. Resantibiotic = 'Y '.
AND IM. CreatedDate between in_fromdate and in_todate
Antibiotic Mar13 Apr13 May13 Name1 10 2 6 name2 2 5 7 Name3 3 6 8
Its nothing but the number of specific antibiotic used these last months.Please help me to say cordially...
Thanks in advance
982895 wrote:
Hi, sorry evryone... Juice I gave the example query. It's the original request:
Select itemshortdesc,
Sum (decode (to_char(DT,'MM-YYYY'),'01-2010', CNT, 0)) JAN2010.
Sum (decode (to_char(DT,'MM-YYYY'),'01-2011', CNT, 0)) JAN2011.
Sum (decode (to_char(DT,'MM-YYYY'),'01-2013', CNT, 0)) JAN2013,.
Sum (decode (to_char(DT,'MM-YYYY'),'02-2010', CNT, 0)) FEB2010
Of
(
Select ic.itemshortdesc, trunc (mr.createddate) dt, count (*) NTC
of adt.inpatientmaster ipm
Join internal ID icm.icm_infectiousdeclaration
on ipm.uhid = ID. Uhid
districts of inner join. PrescriptionDetails PD
the PD. Ipnumber = ipm.inpatientno
join in-house pharmacy.materialrequest MR
on mr.ipno = PD. Ipnumber
Join internal DSM pharmacy.materialrequestdetails
on mrd.materialrequestid = mr.materialrequestid
join in-house pharmacy.itemcompany ic
On ic.itemcode = MRD.itemcode
inner join IM IC_ANTIBIOTIC_MAPPING
ON IM.itemcode = PD. Drugcode
ON ipm.inpatientno = PD. Ipnumber
where IM. Resantibiotic = 1
AND trunc (mr.createddate) between to_date('30-APR-2000','DD-MON-YYYY') and to_date('01-JUN-2013','DD-MON-YYYY')
AND IM. ITEMCODE in ('CRO0006', 'CRO0007', 'CRO0008')
Group of ic.itemshortdesc, trunc (mr.createddate)
) itemshortdesc group
Hello
Try the changes.
Post edited by: Priyasagi
-
CREATE TABLE NSK_ABC (A1 NUMBER, B2 VARCHAR2(100), C1 NUMBER); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK', 1); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK10', 2); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK20', 3); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK', 4); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK50', 5); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK25', 6); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK', 7); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK34', 8); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK456', 9); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK4', 10); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK', 11); Insert into SCPOMGR.NSK_ABC (B2, C1) Values ('NSK', 12); COMMIT; Present Output: b2 c1 NSK 1 NSK10 2 NSK20 3 NSK 4 NSK50 5 NSK25 6 NSK 7 NSK34 8 NSK456 9 NSK4 10 NSK 11 NSK 12 Expected output: NSK 1 1 NSK10 2 2 NSK20 3 3 NSK 4 1 NSK50 5 2 NSK25 6 3 NSK 7 1 NSK34 8 2 NSK456 9 3 NSK4 10 4 NSK 11 1 NSK 12 1 Basically when ever there B2 is NSK, corresponding that value should be 1 and till next value as NSK it should incrment by 1 again when NSK comes in the order values should become 1 I tried query which gives NSK when there is NSK in B2 select b2, c1, val, dc_val from ( select b2, c1, 1 val, decode(b2,'NSK',1,null) dc_val from nsk_abc order by c1);
Or, with analytical...
select b2,c1,row_number() over(partition by sm order by c1) rnk from ( select b2,c1, sum(case when b2='NSK' then 1 else 0 end) over(order by c1) sm from nsk_abc ) order by c1; B2 C1 RNK ---------- ------ ---------- NSK 1 1 NSK10 2 2 NSK20 3 3 NSK 4 1 NSK50 5 2 NSK25 6 3 NSK 7 1 NSK34 8 2 NSK456 9 3 NSK4 10 4 NSK 11 1 NSK 12 1 12 rows selected.
-
Need output 4098 x 1536 H264 - does not have the SOUL?
I'm creating an animation for a large video wall. Care requires mp4/H264. A wall requires 4800 x 1080 and another 4098 x 1536. Adobe Media Encoder won't let me not out beyond 4096 x 952. I understand that the limit is part of the spec H264, but several / V vendors do this request, so there must be a way. But I can't seem to understand.
Any help is very appreciated.
Thank you!
Change MPEG on the highest possible level to enable custom resolutions.
Mylenium
-
Need help with the output of the query formatting
Hello
Here are the scripts to create the table and create test data:
create table result (acct number(10), acct_nm varchar2(100), stage varchar2(10), target_pc number(10,2), long_target_pc number(10,2)) / Insert into RESULT (ACCT, ACCT_NM, STAGE, TARGET_PC, LONG_TARGET_PC) Values (47042, 'Dora the explorer', 'AFTER', 33.6, 48) / Insert into RESULT (ACCT, ACCT_NM, STAGE, TARGET_PC, LONG_TARGET_PC) Values (47042, 'Dora the explorer', 'BEFORE', 33.6, 48) / Insert into RESULT (ACCT, ACCT_NM, STAGE, TARGET_PC, LONG_TARGET_PC) Values (41142, 'Bob the Builder', 'AFTER', 9.18, 20.4) / Insert into RESULT (ACCT, ACCT_NM, STAGE, TARGET_PC, LONG_TARGET_PC) Values (41142, 'Bob the Builder', 'BEFORE', 9.18, 20.4) / Insert into RESULT (ACCT, ACCT_NM, STAGE, TARGET_PC, LONG_TARGET_PC) Values (41086, 'Sofia the first', 'AFTER', 17.96, 51.3) / Insert into RESULT (ACCT, ACCT_NM, STAGE, TARGET_PC, LONG_TARGET_PC) Values (41086, 'Sofia the first', 'BEFORE', 2.98, 8.5) / Insert into RESULT (ACCT, ACCT_NM, STAGE, TARGET_PC, LONG_TARGET_PC) Values (41086, 'Sofia the first', 'BEFORE', 14.98, 42.8) / COMMIT /
I need output in the following format when I query this table:
Account Account Name Stage Target PC Long Target PC 41086 Sofia the first BEFORE 2.98 8.5 14.98 42.8 AFTER 17.96 51.3 41142 Bob the Builder BEFORE 9.18 20.4 AFTER 9.18 20.4 47042 Dora the explorer BEFORE 33.6 48.0 AFTER 33.6 48.0 Total Accounts = 3
Here is what I tried but it does not gives me out I want (below referred to as the code):
spool c:\break_test.txt column acct format 9999999999 column acct_nm format a50 column stage format a15 column target_pc format 999.99 column long_target_pc format 999.99 break on acct, acct_nm, stage select * from result order by acct, stage desc
41086 Sofia the first BEFORE 2.98 8.50 41086 Sofia the first BEFORE 14.98 42.80 41086 Sofia the first AFTER 17.96 51.30 41142 Bob the Builder BEFORE 9.18 20.40 41142 Bob the Builder AFTER 9.18 20.40 47042 Dora the explorer BEFORE 33.60 48.00 47042 Dora the explorer AFTER 33.60 48.00
Please tell us how to get there.
Thanks in advance!
Go back and check the syntax of the PAUSE command.
SQL> column long_target_pc format 999.99 SQL> break on acct, acct_nm, stage SP2-0158: unknown BREAK option "acct_nm,"
The syntax must be
sql> break on acct on acct_nm on stage
-
I use the outgoing/incoming analog DDK with the DAQ 6341 SMU map.
The examples, for example aoex5, show a single timer (method outTimerHelper::loadUI), but the example shows the DMA loaded with same size of vector data.
There is a comment in the outTimerHelper:call rogramUpdateCount, which implies that memory sizes different pad per channel can be used.
(the comment is: switching between the sizes of the various buffers is not used)
Nobody knows what should be the format the DMA buffer for data from multiple channels with different frequencies?
For example, we want a0 with a sinusoid at 1 kHz and a1 with a sine wave of 1.5 Khz. What looks like the DMA buffer?
With the same frequency for each channel, the data are interleaved, for example (ao0 #0, ao1 #0; ao0 ao1 #1, #1,...), but when the frequencies for each channel is different, what the stamp looks like?
Hello Kenstern,
Data are always intertwined since each card has only a single timing for each subsystem engine.
To AO, you must specify the number of samples that will be released to the AO. You also specify the number of channels. Because he didn't is that a single engine timing for AO, each AO will be channel will be updated at the same time to update clock tick. Data will be interlaced exactly as shown in the example because each channel AO needs output at each tick of the clock to update. The data itself can change depending on the frequency you want to copy.
kenstern wrote:
For example, we want a0 with a sinusoid at 1 kHz and a1 with a sine wave of 1.5 Khz. What looks like the DMA buffer?
With the same frequency for each channel, the data are interleaved, for example (ao0 #0, ao1 #0; ao0 ao1 #1, #1,...), but when the frequencies for each channel is different, what the stamp looks like?
In your example, you must come with an update rate that works for the two waveforms (sine waves of 1 and 1.5 KHz). To get a good representation of a sine wave, you need to update more than 10 x faster than your fastest frequency... I would recommend x 100 if possible.
Update frequency: 150 KHz
Channels: 2
Then create you stamps that include complete cycles of each wave you want to produce based on the frequency of update. These buffers must also be of the same size.
Buffer 1: Contains data for the sine wave of 1 KHz, 300 points 2 cycles of sine wave
Buffer 2: Contains data for the sine wave of 1.5 KHz, 300 points, 3 cycles of sine wave
You can Interleave them as before. When the data are performed through the ADC, they are out different sine waves, even if the AO channels are updated at the same speed.
-
Binary output to the digital output as 1111 1111 1111 pin
Hello
I use DAQ 6009 and I need output such as 1111 1111 1111, at the digital output (12) of data acquisition. Please give an idea or a vi to do
Thanks in advance...
Hi DK,.
Look through the viewfinder of the example for example appropriate screws...
In general: open/create one task DAQmx, select all lines, exit TRUE for all channels...
-
I need output Excel spreadsheets .txt files because I have an access point that is able to accept only clean text files (not Word files, etc.). When I do that on my system, the ap gives me an error that he sees the nonprinting characters. I look at the file .txt with a hex editor, and I see that it is completed by the hex 00 between each character. I know I can solve this problem by loading a 32 bit OS, but I can do on the latest data from get system the way I need it?
Hello Al C82,.
Thanks for visiting the site of the community of Microsoft Windows XP. The question you have posted is related to Excel and would be better suited to the community of Office Discussion groups. Please visit the link below to find a community that will support what ask you
http://www.Microsoft.com/Office/Community/en-us/flyoutoverview.mspxSteven
Microsoft Answers Support Engineer
Visit our Microsoft answers feedback Forum and let us know what you think -
Hello
create table test
(
serial_from number (10),
serial_to number (10),
serail_count number (10)
)
/
create table test1
(
serial_from number (10),
serial_to number (10),
face_vale number (10)
)
/
Insert into test (SERIAL_FROM, SERIAL_TO, SERAIL_COUNT)
values (100, 200, 100);
Insert into test (SERIAL_FROM, SERIAL_TO, SERAIL_COUNT)
values (201, 300, 100);
Insert into test (SERIAL_FROM, SERIAL_TO, SERAIL_COUNT)
values (501, 1000, 600);
---------------------------------------------------------------------------------------------
Insert into test1 (SERIAL_FROM, SERIAL_TO, FACE_VALE)
values (50, 120, 15);
Insert into test1 (SERIAL_FROM, SERIAL_TO, FACE_VALE)
values (121, 180, 20);
Insert into test1 (SERIAL_FROM, SERIAL_TO, FACE_VALE)
values (181, 250, 25);
Insert into test1 (SERIAL_FROM, SERIAL_TO, FACE_VALE)
values (251, 350, 30);
-------------------------------------------------------------------------------------
I need output like
Block report
------------------
100 120 15
20 180 121
181 250 25
251 300 30
In this TEST2 with the face value of some serial numbers... I need to divide the valid records from the TEST table.
Hello
How about something like this?
SELECT MIN(CASE WHEN t1.serial_from BETWEEN t.serial_from AND t.serial_to THEN t1.serial_from ELSE t.serial_from END) AS serial_from ,MAX(CASE WHEN t1.serial_to BETWEEN t.serial_from AND t.serial_to THEN t1.serial_to ELSE t.serial_to END) serial_to ,t1.face_vale FROM test1 t1 ,test t WHERE t1.serial_from BETWEEN t.serial_from AND t.serial_to OR t1.serial_to BETWEEN t.serial_from AND t.serial_to GROUP BY face_vale ORDER BY 3
RESULT:
SERIAL_FROM SERIAL_TO FACE_VALE 100 120 15 121 180 20 181 250 25 251 300 30 If it does not meet your needs to know more about her and will fix it.
Kind regards
Steve
-
Need to concat lines to a single column
Hi all
Some examples of data.
col1 col2 col3
125 200 abc
126 200 def
127 200 IGS
128 210 homeless
129 rte 210
130 211 uiy
I need output like this.
col2 col3
200 abc, def, ghi
210 homeless, rte
uiy 211
I need data with order of col1
Could you please let me know how to build the query for this.
Thanks in advance.
Hello
Use the function of aggregation LISTAGG, like this:
SELECT col2
LISTAGG (col3, ",") THE Group (ORDER BY col1) AS col3_list,
FROM table_x
GROUP BY col2
;
This requires that you use Oracle 11.2 or greater.
The generic term for this is the String aggregation.
For more on the aggregation of the chain, including how to do this in earlier versions of Oracle, see ORACLE-BASE - String aggregation Techniques
-
need a few changes at the request of a requirement.
Hi all
I'm using oracle 11g.
Here's my query
CHOOSE a.year_quater,
NVL (a.region_ls, a.region_wp) AS region,
Count (decode (a.final_disposition, '10', 1)) as BRC,
Count (decode (a.final_disposition, '20', 1)) as RO,.
Count (decode (a.final_disposition, '40', 1)) as WPC,
Count (decode (a.final_disposition, '30', 1)) as: fusion,.
Count (decode (a.final_disposition, '60', 1)) as coward
OF ms_fcr_issue one
Group of a.year_quater, NVL (a.region_ls, a.region_wp)
order by region
my putting is like that
Year_Quarter region BRC RO MERGED WPC DROPPED
2013-Q1 EMEA 1 0 0 0 0
2013 Q2 NAM, APAC, LATAM 1 0 0 0 0
2013-Q3 EMEA 1 1 0 0 0
2013-Q4 LATAM 1 0 1 1 0
but I need output like
2013-2013 Q1 - Q2 2013 - 2013 Q3 - Q4
BRC
RO
WPC
MERGED
DROPPED
Concerning
Dale
Output that you provided, this means you want all row values to be null. If so you can try this.
-NOT TESTED
SELECT DISTINCT COLUMNS,
DECODE("2013-Q1",1,) "2013-Q1,"
DECODE("2013-Q2",1,) '2013-Q2.
DECODE("2013-Q3",1,) '2013-Q3. "
DECODE("2013-Q4",1,) '2013-Q4.
DE)
SELECT * FROM (SELECT a.year_quater,
NVL (a.region_ls, a.region_wp) AS region,
Count (decode (a.final_disposition, '10', 1)) as BRC,
Count (decode (a.final_disposition, '20', 1)) as RO,.
Count (decode (a.final_disposition, '40', 1)) as WPC,
Count (decode (a.final_disposition, '30', 1)) as: fusion,.
Count (decode (a.final_disposition, '60', 1)) as coward
OF ms_fcr_issue one
Group of a.year_quater, NVL (a.region_ls, a.region_wp))
UNPIVOT(CODES FOR (COLS) IN (BRC, RO, WPC, MERGED, ABANDONED)))
PIVOT (MAX (CODES) TO (YEAR_QUARTER) IN ("' 2013-Q1 ' AS '2013-Q1', ' 2013-Q2' AS '2013-Q2', ' 2013-Q3' AS"2013-Q3"," Q4 2013' AS '2013-Q4' "" "))
ORDER OF PASSES;
-NOT TESTED
Since you did not provide the INPUT data, I used your output as input current and I tried to do. Select this check box.
() AS T1 (Year_Quarter, Region, BRC, RO, WPC, MERGED, DROPPED)
SELECT "2013-Q1', 'EMEA', DOUBLE UNION ALL 1,0,0,0,0"
SELECT "2013-Q2 ',' NAM, APAC, LATAM', 1, 0, 0, 0, 0 DOUBLE UNION ALL"
SELECT "2013-Q3', 'EMEA', DOUBLE UNION ALL 1,1,0,0,0"
SELECT ' 2013 - Q4', "LATAM", DOUBLE 1,0,1,1,0)
SELECT DISTINCT COLUMNS,
DECODE("2013-Q1",1,) "2013-Q1,"
DECODE("2013-Q2",1,) '2013-Q2.
DECODE("2013-Q3",1,) '2013-Q3. "
DECODE("2013-Q4",1,) '2013-Q4.
DE)
SELECT * FROM T1
UNPIVOT(CODES FOR (COLS) IN (BRC, RO, WPC, MERGED, ABANDONED)))
PIVOT (MAX (CODES) TO (YEAR_QUARTER) IN ("' 2013-Q1 ' AS '2013-Q1', ' 2013-Q2' AS '2013-Q2', ' 2013-Q3' AS"2013-Q3"," Q4 2013' AS '2013-Q4' "" "))
ORDER OF PASSES;
OUTPUT:
PASSES 2013-Q1 2013-2013 Q2 - Q3 - Q4 2013
------- - - - -
BRC
DROPPED
MERGED
RO
WPC
Maybe you are looking for
-
Backups and the effectiveness of programming main HP
I'm contemplating writing a program quite prepared for the first HP and I wonder about the effectiveness and backups. I have several questions that I couldn't find answers to in the Guide of use or in other posts. (1) I understand that HP connectivi
-
Tecra A3 battery stops the charge after a second or two
Hello I used the computer without the battery for a long time. Now, when I try to use the battery it is completely empty (it shows 0% º capacity). It starts to load when it is plugged in, but after a second or two, he stops, so it keeps the ability t
-
Should what graphics driver I install?
I installed fresh Windows 7, yesterday, on my 4330 s Probbok. Icons of the size and the font is wider than ever before. http://h20000.www2.HP.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&cc=us&prodNameId=5045446&... Driver video Intel and con
-
Laptop HP Pavilion 15 for Window 7 64 bit drivers
Hey Im trying to find and install the drivers for my new computer to Win7, but I'm a little to accomplish I have a HP Pavilion 15-n038so Ref: F1E04EA #UUW, if someone could give me some tips where I can find em. So far, I have the drivers for the Eth
-
Hello I had my first PlayBook app approved a week ago, and I would like to ask: -Is it normal to get 'high' sales on the first two days, then very little?, I had a bad review which I have already asked to deny, don't know if this is affect sales... -