Select emp where wu 2

I have a table
emp_wu
ID_EMP number
WORUNIT VARCHAR2
END_DATE DATE
and data:
12 DEV 01.01.2002
12 SOF 01.01.2003
12 SEL 05.02.2003
15 SEL 01.01.2003
15 HAR 01.05.2003
15 SEL 01.06.2003
16 SOF 05.01.2003
16 HAR 29.10.2003
I want to select all emp. from emp_wu table where emp
have worked for more than two (2) workunit?
12 DEV 01.01.2002
12 SOF 01.01.2003
12 SEL 05.02.2003
15 SEL 01.01.2003
15 HAR 01.05.2003
15 SEL 01.06.2003

select id_emp
from   emp_wu
group by id_emp
having count(*) >2

Similar Messages

  • Select * from emp where ename=(procedure1(procedure2(procedure3)));

    I have a big problem
    I have to check the data for quality data
    Lets say i have to check data in emp table
    First i have to check whether the empno is of type number
         IF empno=number then
              if ename starts with a particualar format then
                   ---printouts and this procedure goes on for about 10 coulumns
    I have designed a hard coded procedure where I input table name and column name and the procedure does the checks and give out result
    I have planned to call that procedures here for each checks
    its like i make the procedure to execute and the procedure returns rowid of the correct data
    now i have to apply the second procedure where input is all the rowids of previous procedure and it goes on
    I even dont know whether procedure is correct or function is correct
    Its like select * from emp where ename=(procedure1(procedure2(procedure3)));
    each procedure's output is Rowids only which satisfy a particular format of data
    Please explain me in details
    Please please help me.

    Nested calls are not the best of ideas. Ignoring that for a moment, there are a couple of ways to address this requirement in Oracle. One of these, and likely one of the more scalable ways, is to use Pipeline Table Functions.
    The following code demonstrates the basics of this approach, using pipelined table functions to perform validation checks on data.
    SQL> -- generic type to serve as input cursors to the validation functions
    SQL> create or replace type TFormatCheckRow as object
      2  (
      3          row_identifier  varchar2(30),
      4          value           varchar2(100)
      5  );
      6  /
    Type created.
    SQL>
    SQL> -- validation functions returns the rowid of rows that are valid
    SQL> create or replace type TRowID as object
      2  (
      3          row_identifier  varchar2(30)
      4  );
      5  /
    Type created.
    SQL>
    SQL> create or replace type TRowIDTable is table of TRowID;
      2  /
    Type created.
    SQL>
    SQL>
    SQL> create or replace package LIB is
      2
      3          type    TCursor is REF CURSOR;
      4  end;
      5  /
    Package created.
    SQL>
    SQL> -- sample validation function to check if the value is a valid NUMBER, and
    SQL> -- if so will return the rowid of that row for further processing
    SQL> create or replace function ValidateNumber( c LIB.TCursor ) return TRowIDTable
      2          pipelined is
      3
      4          MAX_FETCH_SIZE  constant number := 100;
      5          type    TBuffer is table of TFormatCheckRow;
      6
      7          buffer  TBuffer;
      8
      9          function IsNumber( val varchar2 ) return boolean is
    10                  n       number;
    11          begin
    12                  n := TO_NUMBER( val );
    13                  return( TRUE );
    14          exception when OTHERS then
    15                  return( FALSE );
    16          end;
    17
    18  begin
    19          loop
    20                  fetch c bulk collect into buffer limit MAX_FETCH_SIZE;
    21
    22                  for i in 1..buffer.Count
    23                  loop
    24                          if IsNumber( buffer(i).value ) then
    25                                  PIPE ROW( TRowID( buffer(i).row_identifier ) );
    26                          end if;
    27                  end loop;
    28
    29                  exit when c%NOTFOUND;
    30          end loop;
    31
    32          close c;
    33
    34          return;
    35  end;
    36  /
    Function created.
    SQL> show error
    No errors.
    SQL>
    SQL>
    SQL> -- a sample table to check
    SQL> create table foo_tab
      2  (
      3          some_value      varchar2(20)
      4  )
      5  /
    Table created.
    SQL>
    SQL>
    SQL> -- put some data into the table
    SQL> insert
      2  into       foo_tab
      3  select
      4          object_id
      5  from       all_objects
      6  where      rownum < 11
      7  /
    10 rows created.
    SQL>
    SQL> insert
      2  into       foo_tab
      3  select
      4          SUBSTR(object_name,1,20)
      5  from       all_objects
      6  where      rownum < 11
      7  /
    10 rows created.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> -- return rowids of all rows from FOO_TAB where the column SOME_VALUE is a valid number
    SQL> select
      2          row_identifier
      3  from       TABLE(ValidateNumber( CURSOR(select TFormatCheckRow(f.rowid,f.some_value) from foo_tab f) ))
      4  /
    ROW_IDENTIFIER
    AAAOQKAAEAAAAFQAAA
    AAAOQKAAEAAAAFQAAB
    AAAOQKAAEAAAAFQAAC
    AAAOQKAAEAAAAFQAAD
    AAAOQKAAEAAAAFQAAE
    AAAOQKAAEAAAAFQAAF
    AAAOQKAAEAAAAFQAAG
    AAAOQKAAEAAAAFQAAH
    AAAOQKAAEAAAAFQAAI
    AAAOQKAAEAAAAFQAAJ
    10 rows selected.
    SQL>
    SQL>
    SQL> -- list the rows that contain valid numbers
    SQL> with ROWID_LIST as
      2  (
      3  select
      4          row_identifier
      5  from       TABLE(ValidateNumber( CURSOR(select TFormatCheckRow(f.rowid,f.some_value) from foo_tab f) ))
      6  )
      7  select
      8          *
      9  from       foo_tab f
    10  where      f.rowid in (select row_identifier from ROWID_LIST)
    11  order by 1
    12  /
    SOME_VALUE
    258
    259
    311
    313
    314
    316
    317
    319
    605
    886
    10 rows selected.
    SQL>

  • Whats the meaning of plus in query : select employeename from emp where emp

    Hi All,
    Can someone please explain me whats the meaning of plus sign in following SQL. I have nevercome across this syntax
    select employeename from emp where empid(+) >= 1234.

    Example of equivalent queries using oracle syntax and ansi syntax
    SQL> ed
    Wrote file afiedt.buf
      1  select d.deptno, d.dname, e.ename
      2  from dept d, emp e
      3* where d.deptno = e.deptno (+)
    SQL> /
        DEPTNO DNAME          ENAME
            20 RESEARCH       SMITH
            30 SALES          ALLEN
            30 SALES          WARD
            20 RESEARCH       JONES
            30 SALES          MARTIN
            30 SALES          BLAKE
            10 ACCOUNTING     CLARK
            20 RESEARCH       SCOTT
            10 ACCOUNTING     KING
            30 SALES          TURNER
            20 RESEARCH       ADAMS
            30 SALES          JAMES
            20 RESEARCH       FORD
            10 ACCOUNTING     MILLER
            40 OPERATIONS
    15 rows selected.
    SQL> ed
    Wrote file afiedt.buf
      1  select d.deptno, d.dname, e.ename
      2* from dept d left outer join emp e on (d.deptno = e.deptno)
    SQL> /
        DEPTNO DNAME          ENAME
            20 RESEARCH       SMITH
            30 SALES          ALLEN
            30 SALES          WARD
            20 RESEARCH       JONES
            30 SALES          MARTIN
            30 SALES          BLAKE
            10 ACCOUNTING     CLARK
            20 RESEARCH       SCOTT
            10 ACCOUNTING     KING
            30 SALES          TURNER
            20 RESEARCH       ADAMS
            30 SALES          JAMES
            20 RESEARCH       FORD
            10 ACCOUNTING     MILLER
            40 OPERATIONS
    15 rows selected.
    SQL>

  • Select  ename from emp where ename like LIKE 's%';

    Hi friends,
    select ename from emp where ename like LIKE 's%';
    output am geting like this naseer
    anusha
    basha
    But I want to display like this naeer    anuha   baha

    784585 wrote:
    Hi friends,
    select ename from emp where ename like LIKE 's%';
    output am geting like this naseer
    anusha
    basha
    But I want to display like this naeer    anuha   baha
    Use REPLACE function:
    SQL>  select replace('naseer','s','') replace from dual;
    REPLACE
    naeerKamran Agayev A.
    Oracle ACE
    My Oracle Video Tutorials - http://kamranagayev.wordpress.com/oracle-video-tutorials/

  • Adobe Acrobat Reader XI no longer copies the selection to where I want to insert it in an MSWord document, but only to the top of the page!  How fix this?

    I have Window 7 Professional SP1.

    fouada2 wrote:
    Adobe Acrobat Reader XI no longer copies the selection to where I want to insert it in an MSWord document, but only to the top of the page!
    I have no idea what this means; can you elaborate?

  • SELECT COUNT(*) WHERE Receiver JDBC?

    How can I do a SELECT COUNT(*) WHERE SQL statement with a Receiver JDBC?

    Hi,
    Refer this document - but if you have select query
    "All return values are returned in an XML structure."
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Hope this helps,
    Regards,
    Moorthy

  • Select count(*) where exists (takes 5 hours).

    Hello Gurus,
    I have two databases on two servers, I am counting how many rows are similiar on two tables that are identical, and the rows should be identical as well. I am running a select count(*) where exists query and it takes 5 hours to complete.
    Each table only has two million rows.
    What can I do to speed it up?

    5 hours to process 2M rows does sound a bit long :(
    I didn't see this mentioned explicitly, but I thought the idea of comparing data on 2 servers implied a database link. Tuning distributed queries can be nasty.
    Start by getting an execution plan of the query to figure out what it is doing. Compare that to the plan generated by the already suggested MINUS operator. You'll need to do MINUS twice with each query in the other's position the second time. Alternately, check the indexing on the subqueries; EXISTS tends to work best with fast indexed lookups. FTS on an EXISTS subquery is not good :(
    Think about copying the data locally to one system or the other first, maybe in a materialized view or even global temporary table.
    Finally, think about tuning the transfer. There are articles on Metalink on tuning the transfer packet sizes (SDU/TDU) which might help IF YOU ARE ON UNIX; I haven't had any luck changing these values on Windows. You can also look into setting tcp.nodelay which can affect when packets get sent (another Metalink article should cover this).

  • Correct way to select records WHERE X ≠ Y

    I'm just starting to learn to create dynamic pages and forms
    and everything has been going very well until now. I'm SURE there
    must be a very simple solution to this because it seems so basic,
    but I have tried everything I can think of and now I'm stuck.
    My table "VENUES" has a column named "ignoreVenue" setup as
    VARCHAR (6), Null (Yes) Default (NULL). I have a corresponding
    checkbox in my form named "ignoreVenue" with "ignore" as its
    checked value.
    I want to create a recordset that only selects records where
    the "ignoreVenue" field is NOT checked. Here is the SQL query I
    tried that seems the most logical to me:
    SELECT *
    FROM VENUES
    WHERE VENUES.ignoreVenue != 'ignore'
    ORDER BY VENUES.venueName
    When I test this with the TEST button in the Wizard dialog or
    in the finished menu on my testing server, there are no records
    listed when, in fact, all but one record should be listed because
    only one of them has "ignore" in the "ignoreVenue" column.
    So here are some variations I tried for 3rd line only, none
    of which worked either:
    WHERE VENUES.ignoreVenue = ''
    WHERE VENUES.ignoreVenue = null
    WHERE VENUES.ignoreVenue = NULL
    WHERE VENUES.ignoreVenue = 'NULL'
    If someone can verify for me that one of these should work
    and which one it is, then will try rebuilding the page once more
    from scratch. But it's a very complex page so I'd prefer not to go
    through all that if I'm on the wrong track to begin with.
    I hope someone has a (simple ;o) answer for me!
    Vera

    veramilomilo wrote:
    > My table "VENUES" has a column named "ignoreVenue" setup
    as VARCHAR (6), Null
    > (Yes) Default (NULL). I have a corresponding checkbox in
    my form named
    > "ignoreVenue" with "ignore" as its checked value.
    You don't say which database you're using, but since your
    column is
    VARCHAR, I assume it's MySQL.
    > I want to create a recordset that only selects records
    where the "ignoreVenue"
    > field is NOT checked.
    Given the description of the column definition, if the field
    is not
    checked, its value will be null.
    Here is the SQL query I tried that seems the most
    > logical to me:
    >
    >
    SELECT *
    > FROM VENUES
    > WHERE VENUES.ignoreVenue != 'ignore'
    > ORDER BY VENUES.venueName
    SELECT *
    FROM VENUES
    WHERE VENUES.ignoreVenue IS NULL
    ORDER BY VENUES.venueName
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • What is the defference between select single * from and select * from Where

    What is the defference between select single * from and select * from Where
    which is prefferable and best one.

    Hai,
    *Difference Between Select Single and Select * from table UpTo One Rows:*
    According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
    select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
    The best way to find out is through sql trace or runtime analysis.
    Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
    The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
    The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
    Mainly:  to read data from
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.

  • Create table bulk_load as select ename from emp where 1=2

    The Above Query will create a new table using the strucure of old but there will be no data..
    Kindly explain me what is meant by "where 1=2"?
    Is it referring the table or column or for just testing the query??

    Is not a rule that you always must use 1=2... look this example:
    sql >> create table t as
    2 select * from all_objects;
    Table created.
    sql >> select count(*) from t;
    COUNT(*)
    43975
    sql >> create table ttt as
    2 select * from t where rownum=0;
    Table created.
    sql >> create table tt as
    2 select * from t where 9=4;
    Table created.

  • When is a secondary index used (in select or where)

    HI All,
    We are confused (and new to ABAP) on the various postings on SDN concerning this topic.  Replies seem to vary.
    We have the following select statement:
    SELECT date1 FROM table2
    WHERE material (from a stored internal table) = material-table2
    AND order (from a stored internal table) = order-table2
    AND delivery method (from a stored internal table) = specific value of table2.
    For a second index to be created, would we create the index for only date1 (since it's the only field we are selecting from table 2) or an index with date1, material, order, delivery method or just what's in the WHERE clause of material, order and delivery method?
    How can you be sure that an index will be used?
    Thank you!

    > We are confused (and new to ABAP)
    seem you are very very new.
    Your question is actually not ABAP indexes etc are SQL and can be found in many textbooks also on Wiki pages. ABAP uses SQL, but does not change much.
    The use index is determined nearly only by the WHERE clause. You want to know the phone number of somebody and you know the name and the address. The Index uses the name and the address as a telephone book. The phone number comes from the table not the index! This is not the secondary index, but the primary index.
    If you search in the internet for phone number, then you can use also a secondary index, i.e. you know only the complete address but not the name. A phone book would not help here.
    Which index is used, if often very simple as in the example, but can become very difficult. That is done by a sophisticated program of the database, the optimizer. Check other resoucres for details.
    Siegfried

  • Offset operation in select statements where clause

    dear experts,
        if i use offset operation in select query , syntactically giving
        me a warning message.
        how to avoid warning message
        without using another internal table populated with  only  jtab+0(10).  
       ex:
              select field1 field2
                        into table   itab
                        from ztable1
                        for all entries in jtab
                        where field =  jtab+0(10).
    thanks in advance.

    No need to populate another internal table...
    when populating jtab from database select ur field twice
    structure for jtab..
    types: begin of ty_jtab,
              field type ...
              field1 type char10,
            end of ty_jtab.
    populate the field twice..
       select ...
                 field
                 field
    into table jtab
    Now u can use the field field1 in the next select
    select field1 field2
    into table itab
    from ztable1
    for all entries in jtab
    where field = jtab-field1.

  • SELECT with WHERE clause for MSAccess from JDBC

    Hi,
    I am new user of MSAccess.I am getting exception: Invalid user type when i was trying the following code:
    String name1=nameTextfield.getText().trim();
    String query="SELECT ID from Suppliers WHERE name=name1;"
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(query);
    while(rs.next())
    String id1=rs.getInt(1);
    System.out.println(id1);
    nameTextField is JTextField in my GUI.
    ID id auto field in table Suppliers.
    I am using MSAccess 97.
    I came to know that the JDBC SQL queries will be different for Access.
    Any body help me how to write SELECT statement?
    Thanks in advance,
    Sai Ram

    name or ID might be reserved words in access. Either change the name of the column or put [] around them. Also, you ar looking for a record where fields name and name1 are equal. You probably don't have a name1 field.
    String name1=nameTextfield.getText().trim();
    String query="SELECT [ID] from Suppliers WHERE [name]='"+name1+"';"
    Pay attention to the single and double quotes I have.

  • How do I select rows  where 2 numbers are closest?

    Hi,
    I need to select one row from each person where the days are the closest between the rows.
    In this example, I have rows of order data, and when a company first set up an account and then a column with the number of days it took for a certain order to be made after they joined.
    I need to select order lines where the number of days between joining and ordering are closest.
    e.g.
    customer date_joined order_date days_between_joining_ordering
    1 1/1/2007 10/1/2007 9
    1 1/1/2007 12/1/2007 11
    1 1/1/2007 12/1/2007 11
    1 1/1/2007 20/1/2007 19
    2 1/1/2007 1/2/2007 0
    2 1/1/2007 11/2/2007 10
    2 1/1/2007 30/2/2007 30
    So what I am looking to end up with in the results is:
    customer date_joined order_date days_between_joining_ordering
    1 1/1/2007 12/1/2007 11
    2 1/1/2007 11/2/2007 10
    So I need one row per customer but where the customers days_between_joining_ordering are the closest together.
    Any ideas on how I can get this through SQL or PL/SQL??
    Thanks
    Daniel

    I'm not sure what criteria you want used to uniquely identify each record, so I just used Patient_ID and FU_Days.
    Anyway with the supplied data this provides the requested output, though I expect you have more than 2 patients in your full dataset. Are you wanting the two closest records for each possible pairing of patients? Or the lowest ranked records for any given patient relative to all the other patients?
    For the first you could probably use this query:
    set echo on
    with INT_MATCH_TCES as
    (select 1 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('10/01/2007','dd/mm/yyyy') post_vl_date, 291 fu_days from dual union all
    select 1 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('12/01/2007','dd/mm/yyyy') post_vl_date, 239 fu_days from dual union all
    select 1 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('12/01/2007','dd/mm/yyyy') post_vl_date, 160 fu_days from dual union all
    select 1 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('20/01/2007','dd/mm/yyyy') post_vl_date, 89 fu_days from dual union all
    select 2 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('01/02/2007','dd/mm/yyyy') post_vl_date, 301 fu_days from dual union all
    select 2 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('01/02/2007','dd/mm/yyyy') post_vl_date, 320 fu_days from dual union all
    select 3 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('01/02/2007','dd/mm/yyyy') post_vl_date, 321 fu_days from dual union all
    select 3 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('01/02/2007','dd/mm/yyyy') post_vl_date, 325 fu_days from dual)
    , ranking as (
      select l.patient_id lid, r.patient_id rid, l.fu_days ldays, r.fu_days rdays,
             abs(l.fu_days - r.fu_days) delta,
             rank() over (partition by l.patient_id, r.patient_id order by abs(l.fu_days - r.fu_days)) rnk,
             least(l.patient_id,r.patient_id) o1,
             greatest(l.patient_id,r.patient_id) o2
      from INT_MATCH_TCES l, INT_MATCH_TCES r
      where l.patient_id <> r.patient_id
    select a.*, delta
    from  INT_MATCH_TCES a, ranking
    where a.patient_id = lid
      and a.fu_days = ldays
      and rnk = 1
    order by o1,o2, a.patient_id
    PATIENT_ID DRUG_LIST        PR_MUTATIONS RT_MUTATIONS POST_VL_DATE FU_DAYS DELTA
    1          3TC+ABACAVIR+AZT *            101E         10-JAN-2007  291     10  
    2          3TC+ABACAVIR+AZT *            101E         01-FEB-2007  301     10  
    1          3TC+ABACAVIR+AZT *            101E         10-JAN-2007  291     30  
    3          3TC+ABACAVIR+AZT *            101E         01-FEB-2007  321     30  
    2          3TC+ABACAVIR+AZT *            101E         01-FEB-2007  320     1   
    3          3TC+ABACAVIR+AZT *            101E         01-FEB-2007  321     1   
    6 rows selectedfor the second just rank patient_id from the previous results by the delta e.g.:
    set echo on
    with INT_MATCH_TCES as
    (select 1 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('10/01/2007','dd/mm/yyyy') post_vl_date, 291 fu_days from dual union all
    select 1 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('12/01/2007','dd/mm/yyyy') post_vl_date, 239 fu_days from dual union all
    select 1 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('12/01/2007','dd/mm/yyyy') post_vl_date, 160 fu_days from dual union all
    select 1 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('20/01/2007','dd/mm/yyyy') post_vl_date, 89 fu_days from dual union all
    select 2 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('01/02/2007','dd/mm/yyyy') post_vl_date, 301 fu_days from dual union all
    select 2 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('01/02/2007','dd/mm/yyyy') post_vl_date, 320 fu_days from dual union all
    select 3 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('01/02/2007','dd/mm/yyyy') post_vl_date, 321 fu_days from dual union all
    select 3 patient_id, '3TC+ABACAVIR+AZT' drug_list, '*' pr_mutations, '101E' rt_mutations, to_date('01/02/2007','dd/mm/yyyy') post_vl_date, 325 fu_days from dual)
    , ranking as (
      select l.patient_id lid, r.patient_id rid, l.fu_days ldays, r.fu_days rdays,
             abs(l.fu_days - r.fu_days) delta,
             rank() over (partition by l.patient_id, r.patient_id order by abs(l.fu_days - r.fu_days)) rnk,
             least(l.patient_id,r.patient_id) o1,
             greatest(l.patient_id,r.patient_id) o2
      from INT_MATCH_TCES l, INT_MATCH_TCES r
      where l.patient_id <> r.patient_id
    , ranking2 as (
      select a.*, delta,
      rank() over (partition by a.patient_id order by delta) rnk2
      from  INT_MATCH_TCES a, ranking
      where a.patient_id = lid
        and a.fu_days = ldays
        and rnk = 1
      order by o1,o2, a.patient_id
    select * from ranking2 where rnk2=1
    PATIENT_ID DRUG_LIST        PR_MUTATIONS RT_MUTATIONS POST_VL_DATE FU_DAYS DELTA RNK2
    1          3TC+ABACAVIR+AZT *            101E         10-JAN-2007  291     10    1  
    2          3TC+ABACAVIR+AZT *            101E         01-FEB-2007  320     1     1  
    3          3TC+ABACAVIR+AZT *            101E         01-FEB-2007  321     1     1  
    3 rows selected

  • How do I create a phone selection menu where the items spin?

    I see other mobile websites where a can selection options from a spinning list like a slot machine.  How do I create one or where would I go to learn about creating them?

    Hi
    You can try panels to create menu , for exact idea can you share any example site where it is implemented.
    Thanks,
    Sanjit

Maybe you are looking for

  • Where are LETOOLS for USB? The "ADB" Driver does not work with Windows XP

    I just give up with Lenovo's arcane maze of endlessly-looping driver searches.  I managed somehow to get something called an "ADB Driver" which was supposed to allow Windows XP to recognize my tablet as a K1 Ideapad.  I downloaded the 8+mb file which

  • Sound Blaster Zx driver install causes IO blue screen

    So things went like this: I received my Sound Blaster Zx today. Opened it up, found that it contained some very handy instructions, so I followed those to the letter. During the installation of the drivers, after I was prompted to choose whether or n

  • Page not rendering correctly

    I have a site I am going to that is not rendering properly, instead of seeing a standard page I see a list of links, followed by pictures. Kind of like you usually see on a "Site Map" page. I have contacted the webmaster and he says it does render pr

  • Kiosk-like Finder/Front Row Alternative?

    Hello, I'm working on a geek-project for personal use and wondering if anyone has any suggestions. Basically, I'm taking an older G4/667 with S-Video out, no monitor (well, a TV, but no good for actually viewing Finder, navigation, etc.) and my only

  • Is there any type of "kidwatch" protection for ipad 2

    Is there anything available for ipad2 that can prevent a user from getting to sexually explicit content? I'm looking for something that will keep a 14 year old from googling and viewing inappropriate content with his friends. Need something that has