find the number of null data

Hello

I'm going to the table like this:

NAME DESC1
1 TEST
1 TEST
1 TEST
2 REVIEW
TEST 3
TEST 3

based on desc1 = 'TEST '.
I need to get the result like:

NAME COUNT (*)
1 3
2 0
3 2

Please help me how to get the result as above.

Hello
It will work
SELECT NAME, SUM (DECODE (DESC1, 'TEST', 1, 0)) IN GROUP OF TEST5 BY NAME ORDER BY 1

Tags: Database

Similar Questions

  • How to find the number of data items in a file written with the ArryToFile function?

    I wrote a table of number in 2 groups of columns in a file using LabWindows/CVI ArrayToFile... Now, if I want to read the file with the FileToArray function so how do I know the number of items in the file. during the time of writing, I know how many elements array to write. But assume that I want the file to be read at a later time, then how to find the number of items in the file, so that I can read the exact number and present it. Thank you all

    Hello

    I start with the second question:

    bytes_read = ReadLine (file_handle, line_buffer, maximum_bytes);

    the second argument is the buffer to store the characters read, so it's an array of characters; It must be large enough to hold maximum_bytes the value NULL, if char [maximum_butes + 1]

    So, obviously the number of lines in your text tiles can be determined in a loop:

    Open the file

    lines = 0;

    While (ReadLine () > 0)

    {

    lines ++;

    }

    Close the file

  • Find the number of days between the dates...

    Hi friends,

    I am new to this development of blackberry applications so I do not know how to find the number of days between two days. Y at - there any API is avilable otherwise we have to write our own code. In fact, I tried GregorianCalendar but I get error that cannot find the symbol but I already imported net.rim.device.api.util and package java.util also... Please give an idea how to solve this problem.

    with respect,

    s.Kumaran.

    Use DateField class instances to represent dates on the screen.

    And your code will be as follows:

    long date1 = date1DateField.getDate ();

    long date2 = date2DateField.getDate ();

  • Query to find the number of attached document

    We've been checking out some of the attachments in the database and identified a number that are are very large, so we want to check what they are.   How can I find the number of invoice/order/request for registration of the ebs if all I have is the info from fnd_documents & fnd_lobs.

    You can collect the size of each by running this script:

    Select fad.entity_name, sum (DBMS_LOB. GETLENGTH (FL.file_data)) SIZE_BYTES;

    Count (*)

    of fnd_documents fnd_lobs fl, fnd_documents_tl fdtl, fd, fnd_attached_documents ADF

    where fd.media_id = fl.file_id

    and fd.document_id = fdtl.document_id

    and fd.document_id = fad.document_id

    and fl.program_name is null

    and fl.expiration_date is null

    and fd.datatype_id = 6

    and fdtl.language = 'en '.

    and (fad.entity_name like '% po2'

    OR fad.entity_name like '% REQ')

    Fad.entity_name group;

    You can find requisitions affected by the following:

    SELECT THE PH. SEGMENT1, PH. PO_REQUISITION_LINES_ALL PL, PH PO_REQUISITION_HEADERS_ALL REQUISITION_HEADER_ID

    WHERE PL. REQUISITION_HEADER_ID = PH. REQUISITION_HEADER_ID

    AND PH. REQUISITION_HEADER_ID in)

    SELECT PK1_VALUE FROM FND_ATTACHED_DOCUMENTS

    WHERE ENTITY_NAME = 'REQ_HEADERS');

    SELECT THE PH. SEGMENT1, PL. REQUISITION_LINE_ID
    OF PO_REQUISITION_LINES_ALL PL,
    PO_REQUISITION_HEADERS_ALL PH
    WHERE PL. REQUISITION_HEADER_ID = PH. REQUISITION_HEADER_ID
    AND PL. REQUISITION_LINE_ID in)

    SELECT PK1_VALUE FROM FND_ATTACHED_DOCUMENTS

    WHERE ENTITY_NAME = 'REQ_LINES');

    Please mark answers 'Proper' or 'Useful', as appropriate, to facilitate solutions to the other participants of the RTO.

    If you do not see these buttons, open the chat in a new window/tab by right clicking on the object and choose "open in a new tab.

    You should see Correct and helpful icons below each post.

  • How to find the difference between two dates in time except Sunday

    Hi all

    I have a table, as shown below.
    SQL> select * from test;
    
    TR_ID                                              CREATE_TIME                                                                       CODE
    -------------------------------------------------- --------------------------------------------------------------------------- ----------
    S12341                                             05-JUN-12 12.20.52.403000 AM                                                      1003
    S12342                                             11-JUN-12 11.15.33.182000 AM                                                      1003
    S12342                                             07-JUN-12 12.00.36.573000 PM                                                      1002
    S12343                                             20-JUN-12 12.34.37.102000 AM                                                      1003
    S12343                                             15-JUN-12 11.34.27.141000 PM                                                      1002
    S12344                                             01-JUL-12 10.01.06.657000 PM                                                      1002
    S12344                                             06-JUL-12 12.01.04.188000 AM                                                      1003
    S12341                                             31-MAY-12 11.20.38.529000 PM                                                      1002
    I would like to know the difference between same tr_ids create_time, which should give out in hours except Sunday.

    For example:

    TR_ID: S12344
    1002_Create_time: July 1, 12 PM 10.01.06.657000 (i.e. Sunday)
    1003_Create_time: 12.01.04.188000 AM 6 July 12

    1002 create time is 22:00 Sunday.

    If the query must exclude only the hours of Sunday which is 10 p.m. to Monday 00 h which is 2 Hrs.

    I tried the sub query after doing a search on this forum but I am not getting the desired output.
    SELECT count(*) FROM (SELECT ROWNUM RNUM,tr_id,create_time CT_1002 FROM test c WHERE c.tr_id='S12344' and 
    ROWNUM <= (select (cast(a.create_time as date)-cast((select create_time from test b where a.tr_id=b.tr_id and code=1002) as date)) 
    from test a where a.code=1003 and a.tr_id=c.tr_id) + 1) d 
    WHERE to_char(cast((select create_time from test e where e.tr_id=d.tr_id and code=1002) as date) + RNUM - 1, 'DY') NOT IN('SUN');
    Need help to get the desired o/p

    Hello

    If I unederstand the problem correctly, that's what you want:

    WITH       got_extrema     AS
    (
         SELECT       tr_id
         ,       CAST (MIN (create_time) AS DATE)     AS start_date
         ,       CAST (MAX (create_time) AS DATE)     AS end_date
         FROM       test
         GROUP BY  tr_id
    )
    SELECT       tr_id
    ,       start_date, end_date          -- If wanted
    ,       24 * ( ( ( TRUNC (end_date,   'IW')          -- Count -1 day for every full week
                        - TRUNC (start_date, 'IW')
                 )
               / -7
                  )
                + LEAST ( end_date               -- If end_date is a Sunday
                            , TRUNC (end_date, 'IW') + 6     -- consider it 00:00:00 on Sunday
                     )
                - CASE
                          WHEN  start_date >= TRUNC (start_date, 'IW') + 6     -- If start_date is a Sunday
                   THEN  TRUNC (start_date, 'IW') + 6               -- consider it 00:00:00 Sunday
                   ELSE  start_date
                      END
                )     AS total_hours
    FROM      got_extrema
    ;
    

    I guess that you don't need to worry about fractions of a second. As you did in the code you have posted, I am to convert the TIMESTAMP to date values, because of DATE arithmetic and functions are so much better than what is available for timestamps.

    Basically, it's just to find the number of days between start_date and end_date and multiplying by 24, with these twists:
    (a) 1 day is deducted for each week between start_date and end_date
    (b) if End_date is a Sunday, none of the end_date himself hours are counted
    (c) If start_date is a Sunday, then all the start_date himself hours are counted. Why these hours should be counted? Because 1 day is already being deducted for the week which includes start_date, which contains only this Sunday.

    TRUNC (dt, 'IW') is the beginning of the ISO week containing dt; in other words, 00:00:00 the or before the dt last Monday. This is not the NLS parameters.

    Of course, I can't test without some sample data and the exact results you want from these data. You may need a little something more If start_date and end_date are both on the same Sunday.
    Whenever you have a problem, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) of all of the tables involved.
    Also post the results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.
    Always tell what version of Oracle you are using.
    See the FAQ forum {message identifier: = 9360002}

  • How to find the number of users connected to the database of the level operating system (Linux)

    Hi all

    Could someone knows how to find the number of users connected to the database without connection with sql * more

    y at - it a command to find?

    example, we have 10 databases in a server, how to find the number of users connected to the special data base without connecting to database(v$session)?

    the Oracle version:-10g, 11g
    Operating system:-OEL4, OEL5, AIX, Solaris

    any help will be appreciated.

    Thanks in advance.

    Thank you.

    Kind regards
    Rajesh.

    but you can say total number of connection with the above given the command? It would also be useful to know.

    See you soon,.
    LKM

  • Need help finding the number of occurrences of a model.

    Hi all

    I need help to find the number of occurrences of a model in the column of the table data.

    Consider the examples of data - column of a row in a table:

    'S-S-S-A-S-S-P-S-S-B-S-A-P-S-S-C '.

    My requirement is:

    I should get the County of S that are immediately preceded by or P.

    for the above data, I should get are counted as 3 + 2 + 1 = 6 (S-S-S-A, S-S-P, S - A)

    The configuration data is stored as type VARCHAR2.

    Thanks in advance,
    Girish G

    Published by: Girish G on July 21, 2011 23:22

    I don't know that there is a better way, then this one:

    SQL> with dt as
      2  (select 'S-S-S-A-S-S-P-S-S-B-S-A-P-S-S-C' str from dual)
      3  SELECT SUM(Regexp_count(Regexp_substr(str, '(S\-?)+(A|P)+', 1,
      4                                     Regexp_count(str, '(S\-?)+(A|P)+') - (
      5                                                  LEVEL - 1 )), 'S')) len
      6  FROM   dt
      7  CONNECT BY LEVEL <= Regexp_count(str, '(S\-?)+(A|P)+')
      8  /
    
           LEN
    ----------
             6
    
  • to find the number of records retrieved in the select statement in the cursor

    Hi all
    with the cursor, I'm selecting select statement together and writing in the .txt file.
    his worksheet, but it should not open the file, if the cursor returns nothing.
    How to find the number of records returned by the select statement in the cursor.
    pls help me.

    Thank you...

    Don't understand what you're trying to say, but maybe it's...

    DECLARE
       vCounter NUMBER;
       -- Other variables...
    BEGIN
       vCounter:=0;
       FOR .. IN cursor LOOP
        IF vCounter=0 THEN
          -- Here open file...
          -- Here write one time data...
        END IF;
        -- Here write cursor data...
        vCounter:=1;
       END LOOP;
    END;
    

    -Clément

  • Find the difference between two date and time

    Hi friends,

    I wanted to find the difference between two date and time, but my qury is slightest error "invalid number."

    select sql_step_num,proc_name,run_seqno,start_date,end_date,(to_char(start_date,'HH24-MI-SS') - to_char(end_date,'HH24-MI-SS') ) as ed  
    from eval.EVAL_RUNTIME_DETAILS
    where trunc(start_date) = trunc(sysdate) 
    order by sql_step_num;

    You try to get the feel between two char strings.
    And more difference between two dates gives a NUMBER of days.
    Try this:

    select sql_step_num,proc_name,run_seqno,start_date,end_date,numtodsinterval(end_date-start_date,'DAY') as ed
    from eval.EVAL_RUNTIME_DETAILS
    where trunc(start_date) = trunc(sysdate)
    order by sql_step_num;
    
  • How can I find the number of pixels is in my photos of the ipad? I sell on ebay and they have new requirements for the photos. 500 pixels on the longest side. Is it possible to increase the pixels on already took pictures?

    How can I find the number of pixels is in my photos of the ipad? I sell on ebay and they have new requirements for the photos. 500 pixels on the longest side. Is it possible to increase the pixels on already took pictures?

    See if this application works for you > https://itunes.apple.com/us/app/image-size/id670766542?mt=8

  • How can I find the number of entries on a Web site when you use 'find '?

    I press Ctrl + F, the "Find" option appears. I type in a text, the 'Search' tab does not show the number of entries. For Firefox 25.0.1, is it possible to find the number of entries using 'find '? This is really essential.

    Thanks for your help!

    Can I afford too, for future versions of FF, the number of entries found in a web page by using the Find must be indicated.

    I'm sure that you need an add-on for that. Maybe:

    https://addons.Mozilla.org/en-us/Firefox/addon/findbar-tweak/

  • How do you find the number on a mid 2009 MacBook AIR

    How do you find the number on a mid 2009 MacBook AIR

    Serial number? Model number?

    https://support.Apple.com/en-us/HT201665

    https://support.Apple.com/en-us/HT201300

  • HP PSC 2410-how to find the number of pages

    I bought a PSC 2410 opportunity and would like to know the total number of pages. Any ideas?

    Hi @jay2769,

    Thank you for your super fast response. Please see these links and print a self test page and check if it displays the number of pages in the printer.

    Link 1: http://support.hp.com/us-en/product/HP-PSC-2400-Photosmart-All-in-One-Printer-series/303752/model/303754/document/c00048606

    Link 2: http://support.hp.com/us-en/product/HP-PSC-2400-Photosmart-All-in-One-Printer-series/303752/model/303754/document/c00048607

    Link 3: http://support.hp.com/us-en/product/HP-PSC-2400-Photosmart-All-in-One-Printer-series/303752/model/303754/document/c02073861/

    As part of the Toolbox (link 3) under one of the tabs, you may find the number of pages for the printer.

    Please let me know how it goes.  To simply say thank you, for my efforts to help, please click the "Thumbs Up" button. If you need more assistance let me know and I will gladly do whatever I can to help. If it helps, please mark it as "acceptable Solution" as well.

    Please take care and have a nice week ahead.

  • P2055 printer: how to find the number of pages printed on hp2055 a toner cartridge

    I would like to know where to find the number of pages printed on my toner cartride existing.

    Hello

    Click the Configuration button and select reports, and then select status supplies.

    Expiration report include the number of pages printed and about remaining for the specific Toner Cartridge.

    Shlomi

  • Can someone help me please to find the number of sms sent from blackberry smartphones?

    Hi all

    I'm new to the blackberry smartphone application development. My requirement is to manage the sms sent from a blackberry smartphone like finding the number of SMS messages sent, the destination not like that. I tried running messagelistener, sendlistener and outboundmessagelistener, but something did not work well. So can someone please help me to solve my problem?

    FYI: 1. I've implemented outboundmessagelistener but couldn't find a way to add this port for listening to my request.

    2. I set up sendlistener and added to my application of the method SMS.addSendListener which does not also carry out my requriement.

    So, please help me if you have an idea in these aspects.

    Thank you

    Sanath

    FOR INFO:

    Import net.rim.blackberry.api.sms.OutboundMessageListener;

    SerializableAttribute public class MainClass extends UiApplication implements OutboundMessageListener

    {

    Public Shared Sub main (String [] args)

    {

    PAP MainClass = new MainClass();

    To make the application enter the thread of events and start treatment

    messages,

    We invoke the enterEventDispatcher() method.

    theApp.enterEventDispatcher () ;}

    public void notifyOutgoingMessage (message Message)

    {

    If (this instanceof text message)

    {

    Here you can not manually counting the SMS

    }

    }

Maybe you are looking for