Get the minimum and maximum values
Hi allPlease, how can I solve the problem below.
WITH DT1 AS
(
SELECT 'A' ID, 3 MIN_VAL FROM DUAL UNION ALL
SELECT 'B' ID, 25 MIN_VAL FROM DUAL UNION ALL
SELECT 'C' ID, 55 MIN_VAL FROM DUAL
),
DT2 AS
(
SELECT 21 MAX_VAL FROM DUAL UNION ALL
SELECT 37 MAX_VAL FROM DUAL UNION ALL
SELECT 41 MAX_VAL FROM DUAL UNION ALL
SELECT 51 MAX_VAL FROM DUAL UNION ALL
SELECT 67 MAX_VAL FROM DUAL UNION ALL
SELECT 76 MAX_VAL FROM DUAL
)
SELECT ID
, MIN_VAL
, MAX_VAL
FROM DT1
, DT2
expected result
--------------------
ID MIN_VAL MAX_VAL
A 3 21
B 25 51
C 55 76
Kind regards
Using the analytical function LEAD:
SQL> WITH DT1 AS
2 (
3 SELECT 'A' ID, 3 MIN_VAL FROM DUAL UNION ALL
4 SELECT 'B' ID, 25 MIN_VAL FROM DUAL UNION ALL
5 SELECT 'C' ID, 55 MIN_VAL FROM DUAL
6 ),
7 DT2 AS
8 (
9 SELECT 21 MAX_VAL FROM DUAL UNION ALL
10 SELECT 37 MAX_VAL FROM DUAL UNION ALL
11 SELECT 41 MAX_VAL FROM DUAL UNION ALL
12 SELECT 51 MAX_VAL FROM DUAL UNION ALL
13 SELECT 67 MAX_VAL FROM DUAL UNION ALL
14 SELECT 76 MAX_VAL FROM DUAL
15 )
16 SELECT ID, MIN_VAL, (select max(max_val)
17 from DT2
18 where max_val
Max
[My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/07/creare-documenti-office-da-plsql/]
Tags: Database
Similar Questions
-
How can I change the minimum and maximum values on a map of metrics.
Sorry, I'm new to vCOPs and it drives me crazy. I searched the community and Google, but found nothing so thought I'd post here. I am interested in a VM in vCOPs and select operations - tab the metric. I add the CPU usage | Use (%) to the table. By default, the y-axis is has a low of-40 and a maximum of 60. Well, my % of the CPU usage never goes below 0% right? It's hard to look at this figure. Also, I like to see usage to 100% as a maximum rather than somewhere just above where is the top of the chart. Looks like there should be an easy way to change the minimum and maximum y, but I can't seem to find it. Can someone show me what I'm missing here?
Thank you
Bob
He does. There is no way to force it to a specific axis. For vC Ops, there is no concept of a "desired" min and max for Y axis in respect to the display by the metric system settings type. All the data is dynamic and can be any value graphically speaking.
-
Hello Philippe,
Take a look at the example below. Retrieves the Min and Max of table X and also correspondent has the value Y.
Best regards
Klas
-
Validate a field with the minimum and maximum values
How can I register a form in Livecycle designer?
Can someone help me with a sample?
Just replied to your other thread.
Paul
-
What is the best way to get the minimum or maximum of a table of numbers value?
Let's say I have a table of numbers: [2,3,3,4,2,2,5,6,7,2]
What is the best way to find the minimum or maximum value in the table?
Now, just get the maximum, I'm a loop in the table and reset a variable to the value if it is greater than the existing value:
What I ended up doing was sorting table (descending to MAX) upward for MIN and then grabbing the first element of the array. Works like a charm in very few lines of code.
Thank you.
-
Two text fields each other also have the values of the minimum and maximum fields?
I have two text boxes that are mutually exclusive: one is a dollar amount per pay period, and the other is an annual amount in dollars. User can enter an amount in the box of one or the other (but not both), and I used the validation for this below script:
Field1 script:
If (event.value) this.getField("Field2").value = "";
Field2 script:
If (event.value) this.getField("Field1").value = "";
Now, I also Inow the field limit with the minimum and maximum amounts for these same fields. But, because the range of field values is an option button other than the custom validation script, it seems that I can't do both because I can choose only one option button:
Is there a way to keep my custom validation scripts so that they are mutually exclusive, but also to impose minimum and maximum amounts for these areas?
You must validate the range using a script.
It will look something like this:
if (event.value) { if (event.value<10 || event.value>100) { app.alert("You must enter a value between 10 and 100."); event.rc = false; } else this.getField("Field2").value = ""; }
-
DAQmx custom scale: How do you define minimum and MAXIMUM values?
Hello everyone,
I am currently using LabVIEW 2010 and meet the following problem with DAQmx custom scale: first, I created a custom linear scale (ordered originally = 0, slope = 50) and then a string that uses this scale. The real signal acquired from a NOR-9205 (module I) is in the order of-8 / + 8 Volts; When I try to read the measurement of the chain, it seems saturated.
I discovered that the change HAVE. Max and the AI. Min by a DAQmx channel property node I can improve the situation, but the fact is: I was not able to define a range of-1000 / + 1000 for instance because it exceeds the maximum allowed, and I get an error!
So, it is the custom to scale?
No one knows how to fix?
It seems not to be any possibility of having a large scale factor! If I want to convert 1V 1000V I will never reach it!
Thank you much for the help.
B.
Hello
The custom scale will be the function that converts the voltage to some units, you can. If you use a linear scale, it is in the form:
Data units user = m * wine + b
where m is the slope and b is the intercept at the origin wine is what happens to the analog input channel.
The MIN and MAX define you are the min and min AFTER the scaling. So if you want 1 volt in Ain channel to appear as 1000 in the code, you:
m = 1000, b = 0
Then your MAX and MIN is limited to-10000 and 10000 when DID channel lies between +-10V. By selecting a MAX or MIN outside this range will cause an error and numbers read apart from this will be so much saturation.
9205 a selectable ranges: ±200 mV, ± 1, ± 5 and ±10 V programmable input ranges. I haven't used the 9205 so I don't know if this range is automatically selected or the user defined in the module preferences. Whatever it is, it will have a possible effect that MAX and MIN are.
For example.
If you did what you said and used slope = 50 and intercept = 0 AND you got the system set to ±10 volts, while the MAXIMUM and minimum that you can set are limited to ±50 * 10 = ±500. So if you try to put a maximum of 1000 in there, you will get an error because it needs to be at + 500 to-500. Your saturation occur at ±10 volts (what is scale ±500)
If the interval is set to +-1 volt, your MAX and MIN should be within-50 to + 50. All values apart from this will produce errors. and if you try to read voltages above + 1 volt (+-50 scaling), there will be saturation.
I hope it is clear and useful.
-Alex-
-
IMAQ statistics block - minimum and maximum value giving 0
Guy - can someone please test. Average and standard deviation give good numbers. Min and Max are the two display zero (0).
Thank you
Don
Do the Boolean calculate Min/Max? true to get Min and Max values.
-
Try to generate minutes date using the minimum and maximum date
Hello
Generate data to date in minutes using the min_time and max_time of the table or query specified, below
The output I am looking for is,With time_data as (SELECT 1 sr, TO_DATE('5/5/2009 7:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM') min_time, TO_DATE('5/5/2009 9:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM') max_time FROM DUAL UNION ALL SELECT 2 sr, TO_DATE('5/5/2009 10:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM') min_time, TO_DATE('5/5/2009 12:00:00 PM', 'MM/DD/YYYY HH:MI:SS AM') max_time FROM DUAL) SELECT * FROM time_data; SR MIN_TIME MAX_TIME 1 5/5/2009 7:00:00 AM 5/5/2009 9:00:00 AM 2 5/5/2009 10:00:00 AM 5/5/2009 12:00:00 PM
I tried this query, but it seems not to work,5/5/2009 7:00 5/5/2009 7:01 5/5/2009 7:02 . . . 5/5/2009 9:00 5/5/2009 10:00 5/5/2009 10:01 5/5/2009 10:02 . . . 5/5/2009 12:00
Ideas please...With time_data as (SELECT 1 sr, TO_DATE('5/5/2009 7:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM') min_time, TO_DATE('5/5/2009 9:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM') max_time FROM DUAL UNION ALL SELECT 2 sr, TO_DATE('5/5/2009 10:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM') min_time, TO_DATE('5/5/2009 12:00:00 PM', 'MM/DD/YYYY HH:MI:SS AM') max_time FROM DUAL) SELECT TRUNC(TRUNC(min_time)+level/1440,'MI') udates FROM time_data connect by TRUNC(TRUNC(min_time)+level/1440,'MI') <= TRUNC(max_time, 'MI');
With 10g
Salim cordially.WITH time_data AS (SELECT 1 sr, TO_DATE ('5/5/2009 7:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM' ) min_time, TO_DATE ('5/5/2009 9:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM' ) max_time FROM DUAL UNION ALL SELECT 2 sr, TO_DATE ('5/5/2009 10:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM' ) min_time, TO_DATE ('5/5/2009 12:00:00 PM', 'MM/DD/YYYY HH:MI:SS AM' ) max_time FROM DUAL) SELECT min_time dt FROM time_data model partition by (sr) dimension by (1 rn) measures( max_time,min_time,(max_time-min_time)*24*60+1 dif) (min_time[for rn from 1 to dif[1] increment 1]=min_time[1]+ numtodsinterval(cv(rn)-1,'minute'));
-
What are the minimum and maximum of a competing request ID numbers
Hello
I was wondering where the concurrent request ID start for example 0,1, or 10000 and where they "check". For example, is it to 9999999, 99999999 or higher.
I have a feeling they start with four or five digits may be 1000, but I could not find a direct reference in the manuals or on the Support website. I don't think that the maximum size of the FND_CONCURRENT_REQUESTS table's history, but can be a problem.
Oh, I mean a 11.5.10.2 instance in my case, but would be interested in the case of the 12 too.
Kind regards
JohnHi John,.
ID of the request is picked on the sequence FND_CONCURRENT_REQUESTS_S, see wats the value in the startup sequence. In 12.1.3.8, it's the same thing in 12.0.6
Simo
-
Change of minimum and maximum voltage that we expect to generate/measure
Hello!
Our application has a FOO and one task of tension HAVE with digraph maxVal + 10 and-10. We acquire/generate n times m samples (for a total of m * n samples). It is possible to reconfigure the digraph/maxVal each of the n times (according to the samples generated/acquis) in a quick way? If I'm not mistaken, it is possible, by stopping and recreating the task (by calling DAQmxClearTask, then DAQmxCreateTask and finally DAQmxCreateAIVoltageChan or DAQmxCreateAOVoltageChan), but as far as I know it is a slow operation and is not a good thing for our application. Are there other ways to do it? In fact, we use the NI PCI-6229 map.
Thanks in advance!
Hello
It is possible to set (and also get) the minimum and maximum values for a channel DAQmx: in LabVIEW property DAQmx channel analog input nodes: Maximum values and Analog Input: minimum, in textual languages with features DAQmxSetAIMin, DAQmxSetAIMax (and similarly for the AO channels).
However, for the boards of the M series it is not possible to set these properties when the task runs, so you will need to stop the task, set the new values and restart the task.
I hope this will help!
Bye!
Licia
-
Font size minimum and maximum in Blackberry
For all developers,.
I want to create a choice field of object that contain any size to set the font...
I wonder what is the minimum and maximum value for the font size...
Maybe in Ui.UNITS_pt or Ui.Unit_px
Thanks for the responses... ^^
I have not seen these figures.
I have never tested the minimum, but the maximum I've tested that works is 60 pixels. I suggest you try to confirm.
I would actually test this on a variety of devices, I suspect that there are differences in the formats supported according to the resolution of the screen.
-
(1) what is the name of this Volume Audio monitor?
(2) what is the ideal minimum and maximum value allowed for a sound quality?
(3) in practice, up to what maximum value can I allow?
(4) what are these numbers? for example dB
Thank you.
1. the audiometers
2. level of reference is usually given as -12 or - 20 for the film. Normal speech level is usually 05:45.
3. less than 0 for forts, ttransient sounds. Highly compressed music will be close to zero.
4. the decibels
-
Each scale minimum and maximum for each slide table slides
Hello
is it possible to set values mini/maxi different scale in a group of slides via property nodes? As far as I know that's not possible. All the slides in the table must have the same minimum and maximum value. I only find a way to change all the scales at the same time. Are there any other ideas?
Thanks in advance
LVW
Hi lvw
You are right on the table, it is not possible to have different scale values. If you don't have a small number, you may be able to use a cluster of sliders, then you can set each individually. You can use the table for cluster and cluster to table to convert data types. You can also use cluster control references to define each level individually.
Ian
-
ScheduledThreadPoolExecutor with minimum and maximum thread
Hi all
I need to implement something that is planning a number of potentially important small tasks over time. I would use a pool of threads to do this in an effective manner. I wish to have a configuration, for example, 1-10 of discussions where the threads are created as needed and if the number of threads max is reached, tasks are queued. The tasks are timed and repeat if I prefer the automated programming of the executor. The deployment environment and the number of tasks to manage will vary so adaptation of configuration and execution is important. When there is no work, I would like to scale down over time as well. Here is my small tent to reach a suitable with competition from Java API design...
Now, looking at my options, it seems that ScheduledThreadPoolExecutor is a good match for my needs. So what I would like to implement is a mechanism to define the minimum and maximum number of threads that are created for the thread pool. I understand that it is the number of threads of"base" and the maximum number of threads in the java.concurrency terminology. However, I struggle to create what I would.
It seems to me that the ScheduledThreadPoolExecutor is always created as a fixed size thread pool. So I can't set that I would have say minimum of threads 1 and a maximum of 10. There is the setMaximumPoolSize() method, I can call on the executor, but he seems to have no effect. If I create my own ThreadFactory, and use that to give me track when new threads are created, create a ScheduledThreadPoolExecutor with one set of threads 1, fixed the limit 2-wire and plan a set of 6 ongoing tasks in loops, it never starts higher than 1 threads. So it seems that it completely ignores the setMaximumPoolSize().
There is the option to call allowCoreThreadTimeOut() and setKeepAliveTime() on the executor. When I look in the code of ScheduledThreadPoolExecutor, I also see that he prestarts always all discussions until number of threads core set when a task is scheduled. So even if I got the coreThreadTimeout and keepAliveTime for work, attributes that can not help me because it would always just he hike up base number. Otherwise maybe I could use that have a 0 min and max of the number of"basic". Or is the coreTimeOut for some other purpose?
Well, the question of the "base" here is, is it possible I could create an executor who creates a number dependent threads according to the need (between x 1 and x 2 that I would define, for example, 1-10) but achieved x 2 at the start of the queue of tasks that come? It seems that the whole API is to assume I want either a fixed number of threads with the unbound queue or an unlimited number of threads with a queue bound. No way to have a set bounded discussions with min and max thread bodies, as well as the queue without terminals when the max thread count is reached? And can I get that with ScheduledThreadPoolExecutor enough, please?
Or maybe I'm just the idea of simultaneity just bad here for somewhere? Is a kind of best practices of competitive access to pigs immediately the maximum number of threads, you think you might need later conflicts of resources? This is why there is only the size of the "fixed"? In all cases, ideas and help is appreciated.
Well thanks for reading this far... and all answers of course!Yes, this particular scenario is difficult to achieve, and Yes, it seems that the standard behavior for me as well. You can sort of achieve this effect by using the feature "allow core of timeout threads. Basically, build you a pool of 'fixed' size with a queue boundless, but the flag 'allow the kernel thread timeout' set to true. This will essentially give you what you want, except that the 'min' size is 0. This seems to be a reasonable compromise to me because you do not need to write custom code (I had already implemented a scenario you describe, a queue of unlimited blocking which 'lies' to be full until the maximum pool size is reached).
example:
ThreadPoolExecutor executor = new ThreadPoolExecutor(maxPoolSize, maxPoolSize, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue
(), threadFactory); executor.allowCoreThreadTimeOut(true); return executor;
Maybe you are looking for
-
I can open a new browser window, but not a new tab, or by clicking on the sign more or select it from the menu. I have completely updated to firefox and also rebooted. What is going on?
-
JO HP 6500 has more 'fax function disabeled.
I have a HP 6500 has JO more I bought several years ago. I used the function of fax for a while because I had a landline. Got rid of the landline so didn't use do not fax on the printer. I don't remember if I've done something somewhere, but now I ge
-
Getting the IP address of the device
How to get programmatically the IP address of the device? -Thank you
-
Uninstalling Lightroom and Bridge
Having had to do a restore of the computer system on my Windows 10 Lightroom and Bridge no longer work. I tried to uninstall, but all I get is "Uninstall failed". Through the clouds, he said that no apps are installed. I would like to know how to get
-
Sorting of emails [REST API] [PHP]
Hello, I am trying to sort emails by using URL parameters. I am trying to sort the messages by date of creation, or in any case that would have the most recently created e-mail first and in descending order.So far, I have https://secure.eloqua.com/AP