difficult query take random value of number to give total = 50

My dear

In Interview

He asked me the Question

If I like these number (1-3-5-7-9-11-13-15)

How can you give me sql statement

only take a number 5 thereof and the amount = 50

Thanks in advance

Just for fun...

SQL > with t (select 1 Union double all the)
2 Select 3 in all the double union
3 select 5 Union double all the
4 Select 7 Union double all the
5 select 9 Union double all the
6 select 11 Union double all the
7 select 13 Union double all the
8. Select double 15
9               )
10. Select str
11 of)
12. Select trim ('+ ' of sys_connect_by_path(x,'+')) Str
13, level l
14 t
15 connect according to the level of nocycle<=>
16 and x > x prior
(17) x
18, xmltable (x.str) y
19 where to_number (y.column_value) = & desired_number
20 and l = & desired_values
21.

Enter the value for desired_number: 35
Enter the value for desired_values: 5

STR
----------------------------------------------------------------------
1 + 3 + 5 + 11 + 15
1 + 3 + 7 + 9 + 15
1 + 3 + 7 + 11 + 13
1 + 5 + 7 + 9 + 13
3 + 5 + 7 + 9 + 11

SQL > /.
Enter the value for desired_number: 35
Enter the value for desired_values: 3

STR
----------------------------------------------------------------------
7 + 13 + 15
9 + 11 + 15

SQL > /.
Enter the value of desired_number: 50
Enter the value for desired_values: 5

no selected line

Tags: Database

Similar Questions

  • Column update with random values

    Hi all

    I have a chart in which one of the columns contains the number. I want to write a script that will update the column number with different random values.

    Basically, my script should take the first line of a table and should update with a random value in the second loop, it must update the column with a random value.

    I need a simple PL SQL code to do this.

    Thanks in advance.

    Thank you.

    Kind regards
    Dirasa

    or

    update table_name set column_name=round(dbms_random.value(1,100));
    

    Do not loop, this single update statement will satisfy your need by your request above.

    arguments passed in 1 100 are the lower and upper limit to generate random numbers. like 5,1,45,64,23 etc.

    Sample of run...

    PRAZY@11gR1> select * from test;
    
            ID
    ----------
             1
             2
             3
             4
             5
    
    Elapsed: 00:00:00.00
    PRAZY@11gR1> update test set id=round(dbms_random.value(1,100));
    
    5 rows updated.
    
    Elapsed: 00:00:00.00
    PRAZY@11gR1> select * from test;
    
            ID
    ----------
             2
            85
            58
            45
            27
    
    Elapsed: 00:00:00.00
    

    Kind regards
    Prazy

    Published by: Prazy on March 17, 2010 17:35

  • DMA FIFO - random values?

    iHi.

    My apologies if this is the wrong Board... not sure where it should go! Just to clarify from the outset, I cannot share screws due to issues of IP etc... sigh.

    Basically I have a sbRio 9626 and the software that runs on the FPGA to interface with analog converters / digital external. This is done using a machine to States (single cycle loop timed with a structure of business inside, so it passes between cases each tick of the clock FPGA). In one of the cases (the States), I have a little routine that takes data from the ADC and place it in a buffer FIFO of DMA of target-to-host. In fact, there are 4 FIFO DMA buffers to send various information and the value of the sample. It is then read by the software on the host of RT and processed to produce an array of values which I then send to the PC using a shared variable.

    What I wanted to check, is that data sent from FPGA to RT host (and PC) are contiguous (that is, I have my right to lengths FIFO). I modified the code FPGA to use a counter instead of the data sampled for the FIFO must simply send numbers in a sequence (1, 2, 3, 4, etc.). I then examine this sequence to ensure that it is correct, and no data has been overwritten.

    I think it's the FIFOs, 2, 3 and 4 are very good. FIFO 1 sends data that is continuous but every now and then I seem to get a glitch at random. This glitch is * not * appear to be due to lengths of FIFO, but seems to be an error in the data transfer. For example, I get something like 1, 2, 3, x, 5, 6, 7, y with x and y the seemingly random values. The positions x and y in the sequence are also seemingly random - they have not held in the same place every time. Code written to the FIFO 1 is * exactly * the same thing others - in fact, it's the same group of data being written.

    Has anyone seen anything like this before? I am trying to determine if it is due to the goal to receive FIFO or some problem with the shared variable in the network. Any suggestions as to what I could check? It almost seems as if there is IME peaks on the transfer... does not suggest this is the case but it gives an idea of what I see. I'm using Labview 2013 and BIOS on the sbRio is up-to-date. I have sbRio another I'll try again later to see if the problem is specific to a particular board.

    It seems that you have found the wrong path here: since you are dealing with the programming of FPGA, which is essentially played woth LabVIEW you should post this question to the Office of LabVIEW or, perhaps, to the Office LabVIEW Embedded

  • reload the page when SQL query returns a value

    Hello world

    the title of this discussion may seem strange, but I'll try to explain why I need this:

    A user has the ability to connect on my APEX application. There are several tabs in my application that are visible only if a certain SQL statement returns a value which is not the case by default. The user has also the ability to download a file that is transferred to an external system that analyzes the file and writes the data in the database. During this writing process - which may take several minutes - conditions for some of the tabs to show the will becomes real (-> the query will return a value). When the user refreshes the page manually, the tabs will be displayed. However, I want the tabs will appear automatically when the condition is met.

    Is it possible to refresh the page as soon as the query returns a value? It is perhaps possible to check it on the client side and trigger a refresh of the page when the condition is met. It would be even better if only the tabset has been updated, but refreshing the full page is fine as well.

    Thank you!

    Here is an overview of how it can be done

    This is possible thanks to a dynamic action being performed on a timer.

    View default tabs and dynamic action hide them on loading the page if they are not to be considered

    Create a dynamic action that will execute your query every 5 seconds or more

    If the query returns data, you can use the dynamic action to show your tabs using javascript

  • random values

    I want to create random values for a particular column.

    create table employee1 (empno, ename varchar2 (50), eword varchar2 (5), issue 4, tdate date default sysdate);


    Insert into employee1 (4200, 'Hyderabad1', random, sysdate values);


    the random value should be 5 digit only.
    No spaces.
    create table employee1(empno number(4), ename varchar2(50), eword varchar2(5), tdate date default sysdate);
    insert into employee1 values (4200,'Hyderabad1',dbms_random.string('X',5) , sysdate);
    
    1 rows inserted
    
    select * from employee1
    
    EMPNO                  ENAME                                              EWORD TDATE
    ---------------------- -------------------------------------------------- ----- -------------------------
    4200                   Hyderabad1                                         QWBIR 03-MAY-12                 
    
    1 rows selected
    
  • How to apply the random value "seed" to multiple images

    So, I'm in a weird situation, have been surfing the net for the solution for more than a day now and can't really find the solution.

    What is it?

    Its a small school project I chose and can't really find a way to do it.

    What I want to achieve?

    I have an image and I want to have like 50 variations of it.

    What have I done?

    I have loaded an image, performed an action that applies the filter called "Wave", the wave dialog I selected a rangeminimum and maximum values.

    The problem I have:

    I made 50 copies of the same image, and then I applied the action through treatment for these 50 images in batches. However, it applies exactly the same settings/values that I saved. It does not really use the beach that is the maximum and minimum values , I selected in the wave dialog box. It seems that when I closed the wave dialog box, the action creates a new value called 'Random seed' when recording and maybe this number seed tells photoshop what to choose between the min and max range provided by the user.

    So is it possible that when I run the action, he'll be looking for a new random value in the range max and the min provided?

    Thank you

    Marolina

    Save the script below in the text with the .jsx extension. Replace the wave filter step in your action with a step that runs the script. The rest of the action can stay the same.

    // seed range detemined by running the filter with the desired settings 10 times
    // and getting the lower and upper range from the scriptlistener log
    // the seed seems to depend on the other values. In another test the seed was
    // a 8 digit number
    var seed = Math.floor((192000-186000)*Math.random()) + 186001;
    app.activeDocument.activeLayer.applyWave(1,93,198,5,35,100,100,WaveType.SINE,UndefinedAreas.REPEATEDGEPIXELS,seed);
    
  • Assign a random value to column?

    I have a Table with a single column, numeric field, about 1/2 million documents.

    I want to add another column, VARCHAR2 and distributed way random value of ' a ',' B', 'C', has '.

    The seed for Random can't be perfect, I just need to fill it with random data.
    so that I can do a test in this Table for a different query, thank you!

    Am on Oracle 10 g 2

    You can try like this,

    update table_name
       set column_name = chr (64 + round (dbms_random.value ( 1, 4)))
    

    G.

  • Take the values of this same line of a column max

    Hello

    I did a group by in a query to date max of straight, but I need to take on values of that same line with this maximum value.

    Max (to_date(fec_ini_vigencia_costo,'DD/mm/YYYY')) is the line I want to take

    and

    -max (mto_precio_venta_cm_iva),
    -fec_fin_vigencia_costo,
    -l.CND_TRASPASADO_PRECIO

    the values I want to take advantage of this line

    select p.item_orms, 
           item_ebs, 
           description, 
           zone_id, 
           max(to_date(fec_ini_vigencia_costo,'DD/MM/YYYY')) as fecha_inicio,
           -- max(mto_precio_venta_cm_iva),
           -- fec_fin_vigencia_costo,
           -- l.CND_TRASPASADO_PRECIO
    from precios9 p,
         cmp_lineas_cotizacion_suc l,
         LCM.CMP_ENCABEZADO_COTIZACION d 
    where p.zone_id = 1
         and l.cod_producto = p.item_ebsi'
         and d.NUM_COTIZACION_ORCL = l.NUM_COTIZACION_ORCL
         and l.cod_sucursal in (125,89,90,92,95,97,99,101,104,106,108,110,112,115,83,85,
                               87,88,91,93,94,96,98,100,102,103,107,109,111,113,114,116,
                               117,120,123,124,128,130,132,134,135,133,131,129,118,182)
    group by p.item_orms, item_ebs, description, zone_id

    Buon Giornio!

    Here are two ways to do it. First of all, using analytical functions and then with a subquery.

    I took your sample data and converted into a WITH statement, so I could test my queries. The SQL code that you need to write is near the bottom.

    WITH dta AS (
    SELECT 100124238 AS ITEM_ORMS,1.1073131 AS ITEM_EBS,'Comino Badia Molido 28Gr' AS DESCRIPTION,1 AS ZONE_ID,TO_DATE('03/02/2007','dd/mm/yyyy') AS FEC_INI_VIGENCIA_COSTO,1.7 AS MTO_PRECIO_VENTA_CM_IVA,TO_DATE('08/12/2010','dd/mm/yyyy') AS FEC_FIN_VIGENCIA_COSTO,'Si' AS CND_TRASPASADO_PRECIO FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('09/06/2008','dd/mm/yyyy'),24.9,TO_DATE('13/04/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/04/2009','dd/mm/yyyy'),31.95,TO_DATE('01/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('01/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('11/06/2009','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('11/06/2009','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'Si' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL UNION ALL
    SELECT 100132641,1.1054401,'Crema Meggle Chantilly Natural 250Gr',1,TO_DATE('13/05/2010','dd/mm/yyyy'),62,TO_DATE('13/05/2010','dd/mm/yyyy'),'No' FROM DUAL
    )
    SELECT DISTINCT
       MAX ( FEC_FIN_VIGENCIA_COSTO ) OVER () FEC_FIN_VIGENCIA_COSTO
      , FIRST_VALUE ( MTO_PRECIO_VENTA_CM_IVA ) OVER ( ORDER BY FEC_FIN_VIGENCIA_COSTO DESC  ) AS MTO_PRECIO_VENTA_CM_IVA
      , FIRST_VALUE (  CND_TRASPASADO_PRECIO  ) OVER ( ORDER BY FEC_FIN_VIGENCIA_COSTO DESC  ) AS FEC_FIN_VIGENCIA_COSTO
    FROM dta
    ;
    
    FEC_FIN_V MTO_PRECIO_VENTA_CM_IVA FE
    --------- ----------------------- --
    08-DEC-10                     1.7 Si
    
    1 row selected.
    

    And here's the subquery

      << omitted the WITH clause here, just to save space >>
    
    SELECT
      MTO_PRECIO_VENTA_CM_IVA
      , FEC_FIN_VIGENCIA_COSTO
      , CND_TRASPASADO_PRECIO
    FROM dta
      WHERE FEC_FIN_VIGENCIA_COSTO = ( SELECT  MAX(  FEC_FIN_VIGENCIA_COSTO )  FROM dta )
    ;
    
      MTO_PRECIO_VENTA_CM_IVA FEC_FIN_V CN
      ----------------------- --------- --
                          1.7 08-DEC-10 Si
    
    1 row selected.
    

    I would caution you to be careful with either technique: you have not specified a deterministic sort. There are a lot of records with the same values in this field. If if were not for the record for December 8, 2010, the highest value would be on May 13, 2010, and there are 22 records with that value. This means that Oracle would have to break the tie.

  • Random value of a circle...!

    Hi all

    I need to get a random value xy of a circle, for example going to propagate circles on stage randomly. Its quiet easy to spread the circle in a square.

    This has been done here...

    ----------------------------------------------------------

    var MC:MovieClip = new MovieClip();

    var squareWidth:Number = 200;
    var squareHeight:Number = 200;

    for (var i: int = 0; i < = 100; i ++) {}
    MC = drawCircle ();
    MC.id = i;
    MC.x = Math.random () * squareWidth;
    MC.y = Math.random () * squareHeight;
    addChild (MC);
    }

    function drawCircle() {}
    var circle: MovieClip = new MovieClip();
    circle.graphics.beginFill (0xFF6600);
    circle.graphics.drawCircle (0,0,10);
    return (circle);
    }

    ----------------------------------------------------------

    Anyone modify this code and propagate these circle inscribed in a circle?

    How about something like this?

    var MC:MovieClip = new MovieClip();

    var squareWidth:Number = 200;
    var squareHeight:Number = 200;

    var boundsRadius:Number = Math.min(squareWidth, squareHeight) 2;
    var boundsCenterPoint:Point = new Point (squareWidth/2, squareHeight/2);
    var circleAnchorPoint:Point;

    Draw a circle to see the limit - REMOVE
    graphics.beginFill (0,0);
    graphics.lineStyle (1,0,1);
    graphics.drawCircle (boundsCenterPoint.x, boundsCenterPoint.y, boundsRadius);

    for (var i: int = 0; i<=100; i++)="">
    MC = drawCircle ();
    MC.id = i;
    circleAnchorPoint = Point.polar)
    (Math.Random () * boundsRadius);
    (((Math.random () * 360) * Math.PI) / 180)
    );
    circleAnchorPoint.offset (boundsCenterPoint.x, boundsCenterPoint.y);

    MC.x = circleAnchorPoint.x;
    MC.y = circleAnchorPoint.y;
    addChild (MC);
    }

    function drawCircle() {}
    var circle: MovieClip = new MovieClip();
    circle.graphics.beginFill (0xFF6600);
    circle.graphics.drawCircle (0,0,10);
    return (circle);
    }

  • When I'm exercising my watch takes random screenshots.

    When I'm exercising my watch takes random screenshots.  Of course, I'm flipping on a trampoline! Yet, no idea why? Or how to prevent? (I'm not acidentally by pressing the side button and the button)

    Hello

    Screenshots are taken when you hold down the side button on your Apple Watch and also press and immediately release the digital Crown. To prevent this from happening by chance (for example by the back of your hand by pressing the buttons when the bending at the level of the wrist), try either:

    • Wear your watch a little higher on your wrist.
    • Wear your watch band most closely during the year (trampoline can also exert sufficient force to move out of the usual position).
    • Wear your watch swivels 180 degrees, so that the digital Crown and side key are on the other side, where they may be less likely to be operated inadvertently.
  • Random values in the transmission of TCP

    Hello

    I capture a unique setting in grayscale (160 x 120) and sent via TCP to a C program. The problem is that, before the reading of the values of actual pixels in the console, the first 8 bytes is composed of some two random values "120" and "160", as shown in the image below. It seems that these two values are 32-bit unsigned integers, since each represents 4 bytes. The values come from the LabVIEW code below?

    Have you not already answered this in your original message thread?  http://forums.NI.com/T5/LabVIEW/sending-8-bit-unsigned-integer-in-LabVIEW/m-p/2695753

    That you marked as resolved?

    The one where it was mentioned that flatten chain has an entry on whether or not you want to prepend the size of tables?

    Do you really think the values of 160 and 120 'random' when in your post you mentioned even you have a table of 160 x 120?

  • JavaScript input parameter should take the value of the element page Apex

    I have a JavaScript function which i dwonloaded ffrom net to generate bar codes

    DrawCode39Barcode(data,checkDigit).

    I call this function in the body of page attribute by using the following script

    < div id = "P5_X" > < / div >

    < script type = "text/javascript" >

    / * < ! [CDATA [* /]]

    function get_object (id) {}

    var object = null;

    If (document.layers) {}

    object = document.layers [id];

    } Else if (document.all) {}

    object = document.all [id];

    } else if (document.getElementById) {}

    object = document.getElementById (id);

    }

    Returns the object;

    }

    get_object('P5_X').innerHTML = DrawCode39Barcode('1-1-1111',0);

    < /script >

    When I run the page, the barcode for the value 1-1-1111' is generated. Please help so that when this page is running it will automatically take the value of the page item P5_X as parameter instead of hard coded value ' 1 - 1-1111'

    I think it would be simpler. You use the same id for the region and the order of the day, they must be different id

    JavaScript code can be in a dynamic action who sets fire to the loading of the page, or load Execute on the page of your page properties section.

    $('#barcode').html (DrawCode39Barcode ($v ('P5_X'), 0));

  • Query takes a long time

    Hi Experts

    I'm using Oracle 11 g, I use under delete query to remove records of staging table.

    under query takes a long time (ranging from 1 hour, even there is no record to delete.

    I created payment_id indexes also did not help.

    delete from siebelwb.stg_p where payment_id not in (select * from siebel.s_src_payment)

    I know NOT of IN is degreding performace, is there another way to write above request so that we can remove them in NOT IN use.

    Try to use NOT EXISTS clause...

    Also you inner query must match the payment_id with query parent then here's the example query...

    removal of siebelwb.stg_p where THERE is NO payment_id (select 1 from siebel.s_src_payment where s_src_payment.payment_id = stg_p.payment_id)

  • Duplicate in the same random value in the composition.

    Is this possible? How can I do with expressions?

    Thank you.

    Well, nothing prevents you to just spit a random value on a global scale, then by linking all your other expressions to it. And the random() method accepts arrays as well if you want it spit only specific predetermined values. You need to read about such things. It is not still own EI, just generic JavaScript.

    Mylenium

  • query takes too long

    Hello

    The following query takes too long (more than 30 minutes), work with 11g.
    The table has three columns RID, ida, geometry and index has been created on all of the columns.
    The table has about 5,40,000 documents of point geometries.

    Please help me with your suggestions. I want to select the geometry in double point where ida = STRING.


    SQL > select a.rid, b.rid from totalrecords, totalrecords b where a.ida = 'CORD' and b.idat = 'CORD' and
    sdo_equal (a.geometry, b.geometry) = 'TRUE' and a.rid! = b.rid order of 1,2;

    concerning

    Hello

    Just glad it helped, don't forget to award points ;-).

    The SDO_JOIN will use the spatial index for a spatial comparison.
    First of all, it will use the index to check which geometries MBR interact, it is the primary filter: http://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_intro.htm#g1000087

    Secondly, you should apply a space MASK, pair of geometries that comes out of the primary filter is then compared according to the MASK, MASK for example = EQUAL, will check these pair of geoms are equal.

    Now, because you have points, the members are the points themselves, so that if their MBR interact, points to interact, which means they are equal.
    This means that the result of the SDO_JOIN points, in this case even a self-join, will give you all the points that are equal.

    But as points are also equal in their car, the join join reflexive sdo, will give you: a = b & one = one but also a b.
    To this effect, you set the a.rowid< b.rowid,="" to="" avoid="" a="a" but="" also="" b="">

    I hope this explains it a little, again read and read great literature (early!), will have a better understanding.

    Good luck

    Luke

Maybe you are looking for

  • Cannot download or update apps

    Hi, since a few days I can not download new applications and cannot be updated or. I checked all the information such as password, everything looks ok and works well on my macbook and an iPad.

  • Link to iTunes 1.1.1 or Older

    I have an iMac G3 with Mac OS 9 and OS X 10.0 Cheetah. I would like to get iTunes installed on Leopard, does anyone know a link for iTunes 1.1.1 or more. There is a link for iTunes 1.1 to support.apple.com/downloads/itunes. But it does not work so un

  • FaceTime "check E-mail address".

    When signing into my iPod touch for Facetime, he asked me to "' check an e-mail address: a verified email address is required to connect to Facetime." " The latter appears in a pop-up with a button "check". I click it and it takes me to the Apple acc

  • Unable to access or connect to the updates of Windows. Error code: 0x8007043B

    Original title - cannot access updates of widows. (Error code: Ox8007043B). How can I re-connect? Running the service pack 3 and IE 8.

  • Source = effect + importing settings

    The SDK guide has a paragraph on the newly introduced in the source of the effect CC 2015 SDK control settings. This paragraph is (to my knowledge) literally the only info on the subject. No comment in the headers or the other.What is the recommended