Multi lines convert to a single line

Dear Group members
I want to convert the queries that return multiple lines in a single line. Scanario is provided for in
select * from inout v
where v.empcode = '00047'
and v. dated = '27-dec-09'

EMPCODE      DATED        IN_TIME   NET_TIME     ATT_STATUS     VAL
00047     27/12/2009     0     0       G             1
00047     27/12/2009     0     0       R             1
00047     27/12/2009     7.44     483       P             1
This query gives multi lines, but I would like to convert it into a line like this
EMPCODE      DATED        IN_TIME   NET_TIME     ATT_STATUS     VAL
00047     27/12/2009     7.44     483       R             1
If the employee came the day that has three traffic status ('G', 'R', 'P'), then it should show in_time, net_time situation and their participation should be 'R '.

In this example there are two rows. I need the line that has in_time > 0, which is the 2nd bet replaces att_status 'P' for 'R '.
EMPCODE      DATED        IN_TIME   NET_TIME     ATT_STATUS     VAL
00047     25/12/2009     0     0       R             1
00047     25/12/2009     7.59     476       P             1
Suppose that there are the 25/12/2009 and employee came that day then it shows the following result.
EMPCODE      DATED        IN_TIME   NET_TIME     ATT_STATUS     VAL
00047     25/12/2009     7.59     476       R             1
It presents 'R' Att_status coloums instead of 'P '.

>
Note that
'G' = blew in gusts
'R' = rest
"P" = present
>

Test case is provided for in
CREATE TABLE INOUT
(
  EMPCODE     VARCHAR2(10),
  DATED       DATE,
  IN_TIME     NUMBER(10,2),
  NET_TIME    NUMBER(10,2),
  ATT_STATUS  VARCHAR2(5),
  VAL         NUMBER(3)
)

insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
values           ('00047','25-DEC-2009',     0    ,       0     ,   'R' ,           1);
insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
values           ('00047','25-DEC-2009',     7.59 ,       476   ,   'P' ,           1);
insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
values           ('00047','27-DEC-2009', 0    ,    0         ,   'G'     ,       1);
insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
values           ('00047','27-DEC-2009',     0    ,       0     ,       'R'     ,       1);
insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
values           ('00047','27-DEC-2009',     7.44 ,       483   ,       'P' ,           1);
Thanks and greetings
select distinct empcode,dated,
       case when cnt>0 then
         max(in_time) over (partition by empcode,dated)
        else
           in_time
        end in_time,
       case when cnt>0 then
         max(net_time) over (partition by empcode,dated)
        else
           net_time
        end net_time,

       case when cnt >0 then
           case when status in  ('G','P','R')  then
            'R'
                when status in ('HCP','1/2') THEN
            'HCP'
           end
         else
           status
        end status
       from (
        select v.empcode,v.dated,v.in_time,v.net_time,(count(*) over (partition by v.empcode,v.dated)) cnt,att_status status
         from inout v
        where v.empcode = '00047')

Published by: Khaled Aradhye, January 20, 2010 02:23

Tags: Database

Similar Questions

  • How do I Center a text entry field can be single or multi-line?

    I have created a form in Adobe Acrobat Pro XI and have almost everything I like.  One of my latest problems trying to get a text in a field of centered text.  The entrance is sometimes a single line and multi-line sometimes.  If I put in place for multi-line entries are centered, then the single line looks like offshore... and vice versa.  Is it possible to have the centered text automatically in the text field single or multi-line?

    Unfortunately, there is no way to set up a field so that the text is guaranteed to be centered vertically in both cases. If you set up so that the rich text formatting is enabled, it is possible for a user centered vertically, but this isn't something you can preconfigure so that it remains in effect when the field is cleaned. For a user to do, with the emphasis placed on the ground that they would have to display the toolbar properties (Ctrl + E), click on the "more..." "> paragraph > alignment > intermediate text [button]

  • How to calculate the height of LabelField when it displays in multi lines

    Hello friends,

    We use LabelField.getPrefereredHeight () to calculate the height of the label field. But he returned the same value when it is displayed online singel or multi line.

    Please help me for differing from the height of the label while displaying field multi-line and single-line

    Thank you very much in advance

    If the code is simple, then you might want to go ahead and post it.  I can't really speculate on exactly the problem in this case unless I see code.  It doesn't sound like you should not show the width and height of your Manager 1 however.  Here is an example of a sublayout of one of my managers:

        protected void sublayout(int width, int height) {
            int numFields = getFieldCount();        int availableHeight = height;
            int totalHeight = 0;
    
            for (int i = 0; i < numFields; i++) {
                Field field = getField(i);
    
                layoutChild(field, width, availableHeight);
                            availableHeight -= field.getHeight;
                totalHeight += field.getHeight();
            }
    
            setExtent(width, totalHeight);
        }
    

    This code is educating the Manager to use the full width so much to her and didn't use as much height as it needs (drunk on her children and adding up their respective Heights).  I don't know if this helps, but if you have any other questions please do not hesitate to post the code and we'll see what happens.

  • How can I add multi line selection in a drop-down list

    I just started with Acrobat DC. Everything is simple, until it isn't. I try to add items to my drop-down list. It's easy. I'm trying to make the choice of multi line. It is an inspection report and the choice will not fit on a single line. So after making the choice, can not read the answer. Thank you-Tim

    It is possible to do it, but only with a script and it's a kind of buggy. In other words, not really a good idea.

  • AutoComplete - see value in the form of multi line + return value.

    Hi Experts,

    I had a simple solution for AutoComplete to see the multi line like: select line1 | Chr (10) | Line2 | Chr (10) | line 3 of une_table.
    In onblur DA it is a process that reduces the value, set the fields another request based on the process of pl/sql.

    After the upgrade to the latest version of apex + modified model - the integer value is displayed as a single line only (no need to any text is indicated).

    I want to manage something like: ExtJs - Ajax search field
    http://Apex.Oracle.com/pls/OTN/f?p=PLAYPEN:1:264121214928301:

    Is there a solution to the APEX to use AutoComplete with multi display value line without incorporating the ExtJs?
    Sorry for my English :)

    Thank you!
    Concerning
    J :D

    I'll add my plugin in 2 or 3 days...

    Welcome

  • Bug? : function in the form "addRow" can't handle multi-line model line

    Hi all

    I created a custom report (model line named column) model which creates 2 lines per registration type (which is actually 2 lines in a HTML table).

    In the APEX feature initTabForm (apex_4_0.js) the line of the sample (f01_0000) is read and stored in gTabFormInitRow

    This is done using a selector to jQuery like this: jQuery('#init_row_'+pRegionID) which returns only the first line of my multi-line record.

    This behavior is expected, or is this a bug? Or do I have to change my HTML structure?

    brgds,
    Peter

    -----
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at
    Training: http://www.click-click.at/apex-4-0-workshops

    Peter,

    This is the expected behavior. It would be impossible to anticipate all HTML structure customers would like to use in their models, on the other hand, although we do not want to keep open and not to lock these models. So in your case, I suggest to go with a table nested in the TR line, this way you can keep your single-TR by sub LINE shape, yet within these lines, have your own table structure.

    Kind regards
    Marc

  • Multi line form and onload

    Hello

    I have a Multi line form (MRF) function wizard based on views (2 tables) with instead of triggers to manage the DML. I have an onchange event on a particular list item select according to each line that simply enables / disables other line items according to the value. It all works well, but I need to repeat the toggle points for each line, once the page is loaded.

    My first thought is to use an event onload in the definition of the Page, but cannot, and should I handle this in a process Page instead (keep in mind that he is a wizard generated MRF)? Also, I need to check that the new lines (via the Add Row button) are managed properly. If I go down the route of onload event, then is the easiest just to get a table (getElementsById?) of items and loop through them? Any thoughts would be most appreciated on the most effective way to do.

    See you soon,.

    PaulB

    Hello

    Yes, it appears same as an onload but, fortunately, does not interfere with any existing onload code - you can have only a single function of the window object onload call.

    You can iterate through the items in the form using something like:

    function disableItems()
    {
    var x = document.getElementsByName("f03");
    var y = document.getElementsByName("f04");
    for (int k = 0; k < x.length; k++)
    {
     if (x(k).value == 'A')
     {
      y(k).disabled = true;
     }
     else
     {
      y(k).disabled = false;
     }
    }
    }
    

    This assumes that the selection list is in column 3 (which should mean that SELECT objects must have a name of "f03" attribute) and that the element you want to toggle is in column 4 ("f04") - so adjust as needed.

    Like you have the same number of items in the column 3 and column 4 - loops above through those in column 3, checks the selected value, and then activates / deactivates the item in the same row in column 4.

    Andy

  • model of multi line search with as

    Hi all

    I use oracle 9i. I want to search for multi - line pattern.

    for example

    Update tablename
    Set the columnname.

    I used select * from user_source where text like "update tablename set columnname %" but this only seems to work if update tablename set columnname is in the same line.

    Thank you.

    Well, no wonder it doesn't work. USER_SOURCE stores a single line of text per line, so the text in the column by definition cannot contain the multiline strings. One solution could be a LEAD analytic function:

    SQL> create or replace
      2    procedure p1
      3      is
      4      begin
      5          update emp
      6             set ename = ename;
      7  end;
      8  /
    
    Procedure created.
    
    SQL> select  distinct name
      2    from  (
      3           select  s.*,
      4                   lead(text) over(partition by name order by line) next_text
      5             from  user_source s
      6          )
      7    where text like '%update emp%'
      8      and next_text like '%set ename%'
      9  /
    
    NAME
    ------------------------------
    P1
    
    SQL> 
    

    SY.

  • Firefox 36.0.1 causes InfoPath 2010 multi-line text boxes do not work - how to fix?

    Since upgrading to Firefox 36.0.1, generated by InfoPath 2010/SharePoint 2010 multi-line text boxes is no longer move to the new lines when the text is entered. Like a lot of text is entered, the cursor remains on the first line.

    36 Firefox in March in favor of the white space in < textarea > style property controls for the first time. So, if the control has a white-space: pre rule, then Firefox will wrap is no longer text in version 36 +.

    Please see this thread for more information and potential code solution:

  • Upgrade to 3.6.15. Now my Add ons (1 password, Download Helper, Multi line Bookmark Toolbar) disappeared. Everyone knows about this problem? Any ideas on how to solve this problem? Thank you.

    Upgrade to 3.6.15. Now my Add ons (1 password, Download Helper, Multi line Bookmark Toolbar) disappeared. Everyone knows about this problem? Any ideas on how to solve this problem? Thank you.

    There may be a problem with one of the files which stores details of the installed extensions. Try to delete these files as described in the section "Corrupt extension files" of this link - https://support.mozilla.com/kb/Unable+to+install+add-ons

    Although this article is not specifically about your problem, the method indicated in the corrupted files extension section can help. When you restart Firefox after you delete these files, the list of installed extensions is rebuilt and cela hopefully solve your problem.

  • Pop up multi line string causes missing "error".

    I need to display a string of long text (multi line) in a pop-up message.

    If I do this with a very long string in the .c file it works (I have several \n in the chain so that it looks OK in the pop-.

    However, if I try to extend the string of text on several lines THAT CVI is complaining, how to do this, I don't want to use a too large number of columns.

    That's what he does not like:

    case EVENT_RIGHT_CLICK:
    MessagePopup ('Run Test Jig Interface Test Help',')
    This test verifies that this program can communicate with
    the ATJ hardware.\n\n this program asks equipment and
    firmware revision of the ATJ and then records the results in this section as well as in the test report");
    break;

    Thank you

    You can split the text on multiple lines by using the line continuation character ' \ ', in this way:

    MessagePopup ("Run Test Jig Interface Test Help",
       "This test verifies that this program can communicate with " \
       "the ATJ hardware.\n\n This program requests the hardware and " \
       "firmware revison of the ATJ and then records the results in this " \
       "section as well as in the test report");
    
  • multi line based on LOV table insert

    SEQ / / desc Ref number value of the option of lov to insert
    15DESC 1011
    16DESC 2022
    17033
    18044
    19055
    20.... 6067

    I have table, need multi line unique insert in process.there is a lov as values from 1 to 10 as number.when return value I select LOV (for example selected value 7) then the rows inserted in table 1 to 7 lines only.the table sequence number must increment as well use.

    Well, if your "seq by trigger" is a sequence number created via a trigger, then you don't need to add yourself as the trigger must do.

    You can then insert the number of rows you want, based on the input parameters...

    Suppose that your values in the apex are: OPT_NUMBER and: SL_NUMBER

    Insert into tablename (option_seq_num, sl_number)
    Select to_char(level,'fm09')
    ,: sl_number + (level-1)
    of the double
    connect by level<=>

    Example of the data...

    SQL > ed
    A written file afiedt.buf

    1 Select to_char(level,'fm09')
    2, & sl_number + (level-1)
    3 double
    4 * connect by level<=>
    SQL > /.
    Enter the value for sl_number: 0
    2 old:, & + sl_number (level-1)
    2 new:, 0 + (level-1)
    Enter the value of opt_number: 10
    4 old: connect by level<=>
    new 4: connect by level<=>

    TO_ 0 + (LEVEL-1)
    --- -----------
    01            0
    02            1
    03            2
    04            3
    05            4
    06            5
    07            6
    08            7
    09            8
    10            9

    10 selected lines.

  • How can I create a multi page PDF from a multi .tif file?  On the creation of a file .pdf from a file multiple .tif, the .tif file is converted to a single page (always the first page of the .tif file) .pdf.  The rest of the document is cut off. The .tif

    How can I create a multi page PDF from a multi .tif file?  On the creation of a file .pdf from a file multiple .tif, the .tif file is converted to a single page (always the first page of the .tif file) .pdf.  The rest of the document is cut off. The .tif file comes from a document by using the fax & Scan app scanner in Windows 10.  I am running Adobe Acrobat Reader DC, which I run with my subscription 'Adobe PDF package, monthly'.  It worked fine until about a month.  I've since upgraded to Windows 10 and Acrobat Reader DC.   I would be very grateful for any help. Eoghainn

    Hello

    This problem has been reported as a bug. Our team of engineers working on this priority issue.

    Kind regards
    Nicos

  • Trying to create a multi-line dialog box

    I worked on a study PDF guide. At the end of each chapter is a self test, and I have some javascript which marks the review when a user clicks a button. Currently, I use a window app.alert to notify the user what responses it is correct and display explanations on incorrect answers. Unfortunately, some of the explanations may be a little long, so I had some tests auto split in several alerts. I have a snippet of code (below) for example to a dialog box, but have been unable to find examples of a multi-line dialog box. A thread has responses as "it is not easy", but no solid examples. Someone at - it an example of a simple dialog box, a line that I could adjust to my needs?

    var oDlg = { 
        description: { name: "Test Dialog", elements: [ { name: "Hello World", type: "static_text", }, { type: "ok", }, ] } 
    }; 
    // Dialog Activation 
    app.execDialog(oDlg);
    
    

    I tried to do something like that, but it barfs on the first carriage return:

    var sText = "Question 5: Incorrect! The correct answer is B\r\rA, C, and D are incorrect. && and || are both short-circuit operators. With &&, when the left side evaluates to false the right side is never evaluated. And with ||, when the left side evaluates to true, the right side is never evaluated.\r\rIn the first statement, i1 does not equal 99 when it is evaluated, so the second expression is printed. However, it is decremented BEFORE the print statement, so the combined value of i and j is 299.\r\rIn the second statement, the left side of the equation evaluates to false, so the right side is never evaluated. Thus the second expression is printed out.\r\rIn the third statement, i3 equates to 100, so the first expression is printed out.\r\rFor the last statement, the left side of the expression is evaluated to true, so the right is never evaluated. The first expression is printed out.\r\rThe final result is 'Value2: 299, Value2: 300, Value1: 299, Value1: 300'";
    
    var oDlg = { 
    description: { name: "Test Dialog", elements: [ { name: SText, type: "static_text", }, { type: "ok", }, ] } 
    }; 
    // Dialog Activation 
    app.execDialog(oDlg);
    

    Any help would be appreciated.

    Here is a basic sample:

    Dialog1 var = {}

    DoDialog: function() {}

    Return app.execDialog (this);

    },

    initialize: function {(dialogue)

    var dlgInit = {}

    "not1": this.strnot1

    };

    Dialog.Load (dlgInit);

    },

    Description: {}

    name: "dlg1."

    elements:

    [

    {

    type: "display."

    elements:

    [

    {

    type: "cluster."

    item_id: "cls1."

    name: "Notes."

    elements:

    [

    {

    type: 'static_text. "

    Multiline: 'true ',.

    item_id: "not1."

    Width: 300,

    height: 300,.

    }

    ]

    }

    ]

    },

    {

    type: "ok."

    }

    ]

    } / / description

    };

    var sText = "Question 5: Incorrect! The correct answer is B\r\rA, C, and D are incorrect. & and | are only two short circuit operators. With &, when the left is set to false, the right side is never evaluated. And with |, when the left evaluates to true, the right side is never evaluated.\r\rIn the first statement, i1 is not equal 99 when it is evaluated, so the second expression is printed. However, it is decremented BEFORE the print statement, so the combined value of i and j is 299.\r\rIn that the second statement, the left side of the equation is set to false, then the right-hand side is never evaluated. The second expression is so printed out.\r\rIn the third statement, i3 is equivalent to 100, so the first expression is printed out.\r\rFor the last statement, the left side of the expression evaluates to true, then the right is never evaluated. The first expression is printed out.\r\rThe end result is ' value2: 299, value2: 300, value1: 299, value1: 300 ft;

    Dialog1.strnot1 = sText;

    Dialog1. DoDialog();

  • How can I increase the attack in a multi-line text box?

    Is this possible?

    I found this ad a few years where someone has asked a similar question:

    http://forums.Adobe.com/thread/286972

    This feature has never been added? If this is not the case-how can I make the code work posted in response to that post?  Just hide the lines would be a good alternative, I think. I tried to add the code to my existing PDF, but seems not to do anything, the lines are still visible when you type in the field.

    No, leading to control has been added and it probably never will be.

    The code at this other thread is not complete because the functions that it calls are not displayed. They are not integrated. Here is a link to a document with a multi-line field that behaves in this way: https://workspaces.acrobat.com/?d=AG6oZ3bi3DYHokxDPeWN7A

    There are several small scripts in various events that control the behavior.

Maybe you are looking for