LINES in COLUMNS with different values for each column (after division)
HelloI have a table called summary where I produced, month, value,.
When I used select * tab, I get months jan, Feb, mar, Apr. I wrote a query to get the months(jan,feb,...) columns
SELECTmax (DECODE(ROWNUM,1,month)) Column1
+ Max (decode(rowNum,2,month)) table Column2 +.
as this up to 12 months
After that, I want to get the NEWVALUE for each month.
I wrote a query to get the value, but I get the value only for the first month, and for the rest, I get NULL values.
Select max (DECODE(ROWNUM,2,vallue)) Column1, Column2 of max table (DECODE(ROWNUM,3,vallue))
Is it possible to get the newvalues for each month (in sql only) if so, please help me
Thank you
Chand
Tags: Database
Similar Questions
-
Two 'sum' s with different requirement for each
Hello...
I am trying to create some statistical queries (reports) using the Oracle10g database
and I was wandering if it was possible for me to create a query "select' with 2 'Sum' function in it to be manipulated under certain conditions.
Here is my case and I'm trying to do.
Lets assume that I have a (STUDENTS) table that contains the information for a students of the University as follows
Students
-----------------
stud_no
between the sexes
main
.. .etc
what I'm trying to do is to get a statistical report for the number of students grouped by the 'major' for each 'sex', there is no training with me using Group By, but I managed to get this way:
SELECT DISTINCT MAJOR,
(SELECT COUNT (STUD_NO)
STUDENTS
WHERE MAJOR = A.MAJOR AND SEX = am') "MALE_COUNT."
(SELECT COUNT (STUD_NO)
STUDENTS
WHERE MAJOR = A.MAJOR AND SEX = 'f') "FEMALE_COUNT".
STUDENTS HAS
ORDER BY A.MAJOR
Is there a more effective way to achieve the same result? I am so concerned about the problem of performance, as it is so important to the system.SELECT A.MAJOR, SUM(CASE A.GENDER WHEN 'm' THEN 1 ELSE 0 END) MALE_COUNT, SUM(CASE A.GENDER WHEN 'f' THEN 1 ELSE 0 END) FEMALE_COUNT FROM STUDENTS A GROUP BY A.MAJOR ORDER BY A.MAJOR /
SY.
-
the list widget with different colors for each item in the list?
I'll add a widget list to my interactive color wheel:
* http://r0k.us/graphics/SIHwheel.html
It is an old applet, first published in 1998 and older than Swing.
The list contains the names of color 1 567 which he knows the color values. I want the background color to each element to be one of the named color. The forefront color name text will be white or black, chosen for readability to her background. Basically, I'm hoping to accomplish what the name of this color page did with its list widget HTML-form:
* http://chir.ag/projects/name-that-color/
I studied the java.awt.list document:
* http://download.oracle.com/javase/1.4.2/docs/api/java/awt/List.html
SetBackground() and setForeground() methods are implemented, but they seem to apply only to the list as a whole. As far as I know, it seems there is no access to list items themselves as components. I hope that I am just missing what is obvious.
-RichWhat you want to do can be easily implemented on a JList swing, with the help of a custom converter. I would advise therefore to rewrite your applet in the swing, then use a JList. That way you can skip JUnit is studying just to force your applet awt to do something of awt was neither designed for and focus on swing of things GUI. Below is an example of how you can implement your JList:
import java.awt.*; import java.math.BigInteger; import java.util.Arrays; import java.util.Comparator; import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; public class ColorList { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new ColorList().createGUI(); } }); } private void createGUI() { String[][] array = getArray(); // sort the array as you wish Arrays.sort(array, new Comparator
() { @Override public int compare(String[] o1, String[] o2) { return o1[1].compareTo(o2[1]); } }); // create the JList final JList list = new JList(array); // set some adequate renderer list.setCellRenderer(new DefaultListCellRenderer() { private static final long serialVersionUID = 1L; @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { DefaultListCellRenderer renderer = (DefaultListCellRenderer) super .getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); renderer.setText(((String[]) value)[1]); int color = new BigInteger(((String[]) value)[0], 16) .intValue(); renderer.setBackground(new Color(color)); renderer.setForeground(new Color(0xFFFFFFFF ^ color)); return renderer; } }); final JLabel demoLabel = new JLabel( "Display this text in the selected color", JLabel.CENTER); list.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { String[] selected = (String[]) list.getSelectedValue(); demoLabel.setForeground(new Color(new BigInteger(selected[0], 16).intValue())); } }); JFrame frame = new JFrame("ColorList"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new JScrollPane(list), BorderLayout.LINE_START); frame.add(demoLabel, BorderLayout.CENTER); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } private String[][] getArray() { return new String[][] { { "000000", "Black" }, { "000080", "Navy Blue" }, { "0000C8", "Dark Blue" }, { "0000FF", "Blue" }, { "000741", "Stratos" }, { "00FF00", "Green" }, { "FF0000", "Red" }, { "FFFFF0", "Ivory" }, { "FFFFFF", "White" } }; } } Piet
-
Form - different default value for each new line needed
Hi all
I'm a newbie in the APEX and now I am struggling with a problem in the form of tables.
On my page, I report master detail, where the detailed part is created in a table form (I used the Wizard).
Now I want to implement the following:
When I click on the button that adds the line of tabular form, I want to assign the default value for the column 'LOGNO' in my tabular form. Value for this column is table extraction and I this value already stored on the page to display one element 'P210_LOGNO_ACT '.
When I click on the button for one second third etc.) times I would like to set the default for the column LOGNO as LOGNO = P210_LOGNO_ACT + 1.
Y at - it something simple, or is - this difficult to attribute the different value to each new row of tabular form?
Version of the apex 4.1.0.00.32
Thanks in advance!
JiriInspect your column and find out the name of your column attribute, it must be something like fxx (f01, f02, f03... etc) and use this column instead of f11 (in my case, the name attribute is f11)
Create a JavaScript function in your page header
function myaddRow() { //perform standard addrow addRow(); //set default value here //make sure you replace the P5_X with your page item name $s('P5_X',parseInt($v('P5_X'))+1); $('input[name="f11"]')[$('input[name="f11"]').length-1].value=$v('P5_X'); }
Change your button to add a line and call the function above, as shown below
javascript:myaddRow();
See this example of work http://apex.oracle.com/pls/apex/f?p=46417:5
-
Max and Min value for each column
Hello!
Can someone help me to change my. VI? I want to get the Min and Max value for each column in the table in the appendices. Then I need to create two tables 1 d - the first with the min and the second with the max value.
I've already solved the problem the solution is below
-
Updated several lines with different values
Hello!
I have a problem. I need to update more than 1000 lines with different values. How can I do?
For exsample I have table:
ID; color, date,
1 red
2 green
3 white
I need to update the date field.
Update table
Set date = '01.02.03'
where id = 1
Update table
Set date = '01.03.03'
where id = 2
Maybe it's how to update multiple rows in a single request?
Sorry for my bad English.
Thank you!Hello
You can try this
UPDATE TABLE SET DATE = CASE WHEN ID = 1 THEN TO_DATE('01-02-03','DD-MM-RR') WHEN ID = 2 THEN TO_DATE('01-03-03','DD-MM-RR') END
see you soon
VT
-
How to acquire of various AI channels simultaneously with a different range for each of them?
How to acquire of various AI channels simultaneously with a different range for each of them?
In LabView, I found some examples but in C it is not seem to be any.
Or you can add channels one by one with individual instructions: the follwing code compilation and runs without error on vitual DAQ hardware:
ERR = DAQmxCreateTask ("", &taskH); ")
ERR = DAQmxCreateAIVoltageChan (taskH, ' Dev1/ai0', 'AI0', DAQmx_Val_Cfg_Default,-5,0, 5.0, DAQmx_Val_Volts, "");
ERR = DAQmxCreateAIVoltageChan (taskH, ' Dev1/ai1', 'AI1', DAQmx_Val_Cfg_Default,-10,0, 10.0, DAQmx_Val_Volts, "");
DAQmxStartTask (taskH);
ERR = DAQmxReadAnalogF64 (taskH, 5, 10.0, DAQmx_Val_GroupByChannel, val, 10, & read, 0);
DAQmxClearTask (taskH);
-
two rows of delete with different values
Hello
I wouldn't lines with the same id and have values of E and F 10258932.
I would like the following data:
But I have the following lines:A B C D E N -------- -- ------ ----- - - 10258927 1 103,35 0 10258929 3 284,85 89,52 E N 10258929 4 323,85 89,52 E N 10258930 5 478,80 91,53 E N 10258931 6 436,67 78,09 E N
Does anyone have an idea?SQL> with my_table as 2 ( 3 select '10258927' a, '1' b, '103,35' c, '0' d, NULL e from dual union all 4 select '10258928' a, '2' b, '0' c, '15,19' d, 'E' e from dual union all 5 select '10258929' a, '3' b, '284,85' c, '89,52' d, 'E' e from dual union all 6 select '10258929' a, '4' b, '323,85' c, '89,52' d, 'E' e from dual union all 7 select '10258930' a, '5' b, '478,80' c, '91,53' d, 'E' e from dual union all 8 select '10258931' a, '6' b, '436,67' c, '78,09' d, 'E' e from dual union all 9 select '10258932' a, '7' b, '784,88' c, '23,19' d, 'E' e from dual union all 10 select '10258932' a, '8' b, '100,88' c, '11,11' d, 'E' e from dual union all 11 select '10258932' a, '9' b, '300,88' c, '22,22' d, 'F' e from dual union all 12 select '10258932' a, '10' b, '468,25' c, '78,33' d, 'F' e from dual) 13 select a, b, c, d, e, no_ds from 14 ( 15 select a, b, c, d, e, 16 case when c > 0 and e != 'F' 17 then 'N' 18 end no_ds 19 from my_table) 20 where no_ds = 'N' or e is null 21 order by 1 22 / A B C D E N -------- -- ------ ----- - - 10258927 1 103,35 0 10258929 3 284,85 89,52 E N 10258929 4 323,85 89,52 E N 10258930 5 478,80 91,53 E N 10258931 6 436,67 78,09 E N 10258932 7 784,88 23,19 E N 10258932 8 100,88 11,11 E N 7 Zeilen ausgewählt. SQL>
Oh, I read the title again once: 'remove double lines with different values.
If it means that he is not specifically E and F values, but only if there is more than one distinct value, then you can do the following:with my_table as ( select '10258927' a, '1' b, '103,35' c, '0' d, NULL e from dual union all select '10258928' a, '2' b, '0' c, '15,19' d, 'E' e from dual union all select '10258929' a, '3' b, '284,85' c, '89,52' d, 'E' e from dual union all select '10258929' a, '4' b, '323,85' c, '89,52' d, 'E' e from dual union all select '10258930' a, '5' b, '478,80' c, '91,53' d, 'E' e from dual union all select '10258931' a, '6' b, '436,67' c, '78,09' d, 'E' e from dual union all select '10258932' a, '7' b, '784,88' c, '23,19' d, 'E' e from dual union all select '10258932' a, '8' b, '100,88' c, '11,11' d, 'E' e from dual union all select '10258932' a, '9' b, '300,88' c, '22,22' d, 'F' e from dual union all select '10258932' a, '10' b, '468,25' c, '78,33' d, 'F' e from dual ) -- -- end-of-test-data -- select a, b, c, d, e, num_distinct_values from ( select a, b, c, d, e, count(distinct e) over (partition by a) num_distinct_values from my_table) where num_distinct_values <= 1 order by 1 /
The county notes how the distinct non-null values in column e for each one.
Where clause then selects those with count = 0 (this is where e = null) and count = 1.
If the number is greater than 1, different values exist for this id.Choose what fits your condition ;-)
-
DAQmx create track (I-current-Basic) 8 channels with different values of Shunt resistance
Hello
I want to measure 8 current channels with different values of Shunt resistance.
Problem: The channel create DAQmx (HAVE current Basic) specifies that a value of Shunt resistance.
How can I set the value of Shunt resistance for each channel individually?
Concerning
Marcel
Hi Marcel_C,
Take a look to get attached.
Best regards
Mencef
-
reuse of filters with different values
We have a usage scenario where the same filters will have to be applied several times with different values. Looking the javadocs, it seems like there is no way to change the values of pre-packaged filters (EqualsFilter, GreaterFilter etc.). Is that correct or is there a way to do it? I see that if we use CohQL, we can use bind variables to do this. However, the use cases we should rather just more complex extractors ReflectionFilters.
In addition, there no performance impact by using CohQL against java constructs directly?
Thank you
Manju.Hi Manju,
While it is true that you cannot change values in the built in filters, even if you could it wouldn't make you save a lot on the construction of a new filter every time. I guess that if you build a very large number of filters, then you're going to create more garbage, but that shouldn't be a problem either. Some of the more specialized filters also contain State so that you do not want to resuse them.
The main performance issue I know with CohQL which is only creates extractors of reflection so won't enjoy all serialized POF values you have. If you have indexed each value you want to query on using the same extractors relflection then it would help, but again, this means that everything you deserialization of the values for the query or insert to update the index.
Kind regards
JK -
Web Gallery - different caption for each photo - broken?
It's something I've done successfully with versions before LR2.5 but for some reason that I cannot now create different captions for each photo. The help page in line said: "to display a different caption or title for each photo, click on the menu of settings customized to the right of title or a legend and choose Edit. In the patterns of text editor that appears, insert the IPTC title or caption metadata element, and then click Done. »
This does not happen. If I create a title for the first photo, it appears for all others. If I change the caption for the second picture, everything changes, including the first caption of the photo. Is this a new bug, or am I just missing something?
I can always change the HTML gallery, but it is not an elegant solution, to say the least.
Help appreciated.
DN
Enter the title or caption in the library, in the metadata Panel. And select the items in the grid. The titles that you change apply to the web gallery, not the individual photos.
-
Cisco ISE 1.3 - Mab authentication with a vlan for each foor
Hello
A client wants to implement authentication MAB with a vlan for each floor. I found a solution of Loïc
I have set up the following:
-the profile of different authentication with a vlan different.
-Add the endpoint (printer etc) endpoint identity.
-create endpoint group identity that end point of recall.
-create a rule to authorizzation reminding all work and element... in the end.
Do you know if there is a faster way where another way to solve the problem?
Thank you all
Well, mab in some environments, could be replaced by profiling and for rules, rather af with a rule authz for each floor, you can name your VLAN in your eponymous switches to "Printers", in the world, then you would only need an authz rule, where you use the name of the vlan instead of identification number, so no matter where this printer , it will end in the vlan 'Printer', whatever it is in this specific switch.
-
How can I create a slide show 100% width, but have the caption in different positions for each slide.
There is placement of the legend only one for all the images in a slide show.
The slideshow widget is specialized to create slideshows of the image. The widget of composition is a much more flexible widget which allows any combination of images and text in the trigger containers or containers of target of the widget. A widget of composition could be used to create a slide show with several legends by image and/or legends of different places for each image. The disadvantage of the widget of composition is that, due to the nature flexible widget, very little is automated for you and so it is much more intensive work to create a slideshow of images using the widget of composition.
Thank you
Sanjit
-
How to find the first max value for each item
Hello
I have the me_result of the table as below,
SELECT * FROM me_result;
ID ||| ELITE ||||||||||| FREQ_ITEM | COMBINED_STR | SUP
1 ||; 1; 10; 2; 3; 4; 5; 7; 8. 1 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
2 ||; 1; 10; 2; 3; 4; 5; 7; 8. 2 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
3 ||; 1; 10; 2; 3; 4; 5; 7; 8. 3 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
4 ||; 1; 10; 2; 3; 4; 5; 7; 8. 4 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
5 ||; 1; 10; 2; 3; 4; 5; 7; 8. 5 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
6 ||; 10; 2; 3; 4; 5; 8; 9. 1 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9; 1 ||| 1
7 ||; 10; 2; 3; 4; 5; 8; 9. 2 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
8 ||; 10; 2; 3; 4; 5; 8; 9. 3 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
9 ||; 10; 2; 3; 4; 5; 8; 9. 4 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
10 ||; 10; 2; 3; 4; 5; 8; 9. 5 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
I need to find the first COMBINED_STR max for each element of the ELITE,
I mean, max value is the max REGEXP_COUNT (combined_str,' ;')))
really, I try to write down, but I had a lot of values for each ELITE and I need only the first, that
SELECT * from me_result
WHERE (ELITE, REGEXP_COUNT (combined_str,' ;')))) IN
(SELECT ELITE, MAX (REGEXP_COUNT (combined_str,' ;'))))) ME_RESULT ELITE GROUP);
I need the result to be as below.
1; 1; 10; 2; 3; 4; 5; 7; 8-1; 1; 10; 2; 3; 4; 5; 7; : p
6; 10; 2; 3; 4; 5; 8; 9 1; 10; 2; 3; 4; 5; 8; 9; 1 1
any help please,.
Published by: user11309581 on July 10, 2011 22:03Can be
with t as (select 1 ID, ';1;10;2;3;4;5;7;8' ELITE, 1 FREQ_ITEM, ';1;10;2;3;4;5;7;8' COMBINED_STR, 2 SUP from dual union all select 2 ,';1;10;2;3;4;5;7;8' ,2 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 3 ,';1;10;2;3;4;5;7;8' ,3 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 4 ,';1;10;2;3;4;5;7;8' ,4 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 5 ,';1;10;2;3;4;5;7;8' ,5 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 6 ,';10;2;3;4;5;8;9' ,1 ,';10;2;3;4;5;8;9;1' ,1 from dual union all select 7 ,';10;2;3;4;5;8;9' ,2 ,';10;2;3;4;5;8;9' ,2 from dual union all select 8 ,';10;2;3;4;5;8;9' ,3 ,';10;2;3;4;5;8;9' ,2 from dual union all select 9 ,';10;2;3;4;5;8;9' ,4 ,';10;2;3;4;5;8;9' ,2 from dual union all select 10 ,';10;2;3;4;5;8;9' ,5 ,';10;2;3;4;5;8;9' ,2 from dual ) select ID,ELITE,FREQ_ITEM,COMBINED_STR,SUP from ( SELECT ID,ELITE,FREQ_ITEM,COMBINED_STR,SUP, ROW_NUMBER() over (PARTITION BY ELITE order by id) RN FROM t WHERE (ELITE,REGEXP_COUNT(combined_str,';')) IN (SELECT ELITE,MAX(REGEXP_COUNT(combined_str,';')) FROM t GROUP BY ELITE) ) where RN=1 order by id ID ELITE FREQ_ITEM COMBINED_STR SUP ---------------------- ----------------- ---------------------- ----------------- ---------------------- 1 ;1;10;2;3;4;5;7;8 1 ;1;10;2;3;4;5;7;8 2 6 ;10;2;3;4;5;8;9 1 ;10;2;3;4;5;8;9;1 1
-
Export of several video tracks in 1 file with different effects on each track.
I'm currently trying to export 3 MP4 1 video tracks.
Each track contains exactly the same images, but with different effects for a certain aesthetic.
When I view the sequence he first that 3 of all titles is displayed correctly.
The exported version only seems to export the Summit track, Track3.
Track 2 and 3 have opacity at 47%.
Track 1 opacity is set to 100%.
I tried to export a test project that has several layers, and it was no problem.
I have tried exporting a test project with exactly the same opacities and effects, as it is a little of your time. So I will do if I can't get a solution of stisafctory in the forums.
The problem, in my view, is the superposition of the effects. In this case on track 3 I have procamp, which reinforces the red in 1 layer. This is the image I get once the last piece is exported - track 3.
Then.
How can I get the effects of each layer to display correctly export?
and
Why the exported version missing securities (or the effects of the tracks) 1 and 2?
Need to know:
- The layer source footage
- Effects that you use
- How you have the sequence in place, for example how are extracted and stacked effects
- Hardware or software MPE
- Maximum bit depth: on or off
- Maximum render quality: on or off
- Destination format
Let's start there.
Maybe you are looking for
-
pop up saying that a device is connected to my Imac with IP
My iMac is completely compromised after having an intrusion on my internet router. I supported everthing this summer. I tried to reset my IMac to factory settings. A pop up came in September saying that another device is connected to my internet con
-
Hello... Highway 2013 with GPS Locator accepts the format longitude and latitude to find addresses in continental Europe. Also will it store tagged and entered multiple, as does Google Earth in this format? It is my intention to travel throughout Eur
-
Changes username after login?
Hello I'm having a problem at my work. The company is in a domain environment running Microsoft Active Directory. I created a domain named John Doe user. I can log on to the domain using the credentials of John Doe very well. My question is after I c
-
Failed to update Windows and Update Installation failures the package
Hello world I have a new 1650 precision and I tried to install the KB971033 from Microsoft updates as well as IE 10 update and they constantly risk to fail. When I manually installed KB971033 my PC blue screened and then restarted and uninstalled th
-
I need to download my first Pro CS 5.5 original version I don't know where to go, tx
I have a Premier Pro version 5.5 cs but need to download, any help where to go?Thank you.