How i will find out  count of record

there is a table emp.it consist two column CODE ,COUNTRY. has value like
1, india
1,china
1,japan
1,koria
2,india
2,china
2, japan
2,viatenam
2,finland
3,india
3,japan
3,china
3,america
3,russia
4, jermany
4,france
i want to see distinct count of record which consist country 'india','china','japan'(a code which has all these 3 values). according to this value output should be 3 (1,2,3)

Better suited for PL/SQL forum and here is my attempt at solving this.
SQL> with datatab as (select 1 code, 'india' country from dual
  2  union all
  3  select 1,'china' from dual
  4  union all
  5  select 1,'japan' from dual
  6  union all
  7  select 1,'koria' from dual
  8  union all
  9  select 2,'india' from dual
10  union all
11  select 2,'china' from dual
12  union all
13  select 2, 'japan' from dual
14  union all
15  select 2,'viatenam' from dual
16  union all
17  select 2,'finland' from dual
18  union all
19  select 3,'india' from dual
20  union all
21  select 3,'japan' from dual
22  union all
23  select 3,'china' from dual
24  union all
25  select 3,'america' from dual
26  union all
27  select 3,'russia' from dual
28  union all
29  select 4, 'jermany' from dual
30  union all
31  select 4, 'france' from dual)
32  select distinct a.code from datatab a
33  where 3 = (select count(code) from datatab b where a.code =b.code and b.country in ('india','china','japan'));
      CODE
         1
         2
         3
3 rows selected.

Similar Messages

  • In webdynpro how we will find out application name if you know the URL

    I know the URL in webdynpro, than how can i find out application, please it is urgent

    Hi Jagan.
    I would like to suggest a few references,
    [SAP HELP - Standard Reference for URL parameters and Application parameters in Webdynpro|http://help.sap.com/saphelp_nw04s/helpdata/en/7b/fb57412df8091de10000000a155106/frameset.htm]
    [SAP HELP - Standard Reference for URL of a WebDynpro Application|http://help.sap.com/saphelp_nw04s/helpdata/en/8c/780741375cf16fe10000000a1550b0/frameset.htm]
    [SAP HELP - Standard Reference for Using paramters for Calling a Web Dynpro Application|http://help.sap.com/saphelp_nw04s/helpdata/en/2f/e7574174c58547e10000000a1550b0/frameset.htm]
    [SDN - Reference for Call another WD Application (Web Dynpro for ABAP)|Call another WD Application (Web Dynpro for ABAP);
    Hope that's usefull.
    Good Luck & Regards.
    Harsh Dave

  • How to find out that a record is empty or null

    hi
    how can i find out that a record is empty or null.
    in other languages when a object or record is not initialized it will be null.
    after initialization how can i find out its values are null. so far i tried this
    declare
    v_r_emp emp%rowtype := null;
    BEGIN
         if (v_r_emp is null) then
         dbms_output.put_line('record is not initialized');
         end if;
    END;
    it seems in plsql we can assign null but cannot compare it with null clause why? if we are able of assign null we must should about to compare it with null too.
    also how record can be made empty. how can we find out that a record variable is empty
    please help me to understand the concept
    thanks

    You need to check every element in the record.

  • How to find out the latest Record in per_all_people_f and per_all_assignme

    Hi ,
    How to find out the latest Record in per_all_people_f and per_all_assignments_f
    Requirement : Need to find out the latest record in per_all_people_f and per_all_assignments_f to update the attribute column with pre defined value . Its not possible to track only with person_id / assignment_id and effective end date
    SELECT pp_id
    FROM (SELECT app.person_id pp_id,
    asf.*
    FROM apps.per_all_people_f app,
    apps.per_all_assignments_f asf
    WHERE --app.person_id=123568 and
    asf.person_id = app.person_id AND
    app.effective_end_date = to_date('31-dec-4712') AND
    asf.effective_end_date = to_date('31-dec-4712')
    GROUP BY app.person_id)
    HAVING COUNT(pp_id) > 1
    GROUP BY pp_id
    This query also returns more than 1 value for person_id .
    It would be great if you put comment on this .. Thanks in advance ,
    Arya

    I am getting more records with asf.primary_flag='Y' . If you give ur mail id , i will send the sample data
    ASSIGNMENT_ID     EFFECTIVE_START_DATE     EFFECTIVE_END_DATE     BUSINESS_GROUP_ID     RECRUITER_ID     GRADE_ID     POSITION_ID     JOB_ID     ASSIGNMENT_STATUS_TYPE_ID     PAYROLL_ID     LOCATION_ID     PERSON_REFERRED_BY_ID     SUPERVISOR_ID     SPECIAL_CEILING_STEP_ID     PERSON_ID     RECRUITMENT_ACTIVITY_ID     SOURCE_ORGANIZATION_ID     ORGANIZATION_ID     PEOPLE_GROUP_ID     SOFT_CODING_KEYFLEX_ID     VACANCY_ID     PAY_BASIS_ID     ASSIGNMENT_SEQUENCE     ASSIGNMENT_TYPE     PRIMARY_FLAG     APPLICATION_ID     ASSIGNMENT_NUMBER     CHANGE_REASON     COMMENT_ID     DATE_PROBATION_END     DEFAULT_CODE_COMB_ID     EMPLOYMENT_CATEGORY     FREQUENCY     INTERNAL_ADDRESS_LINE     MANAGER_FLAG     NORMAL_HOURS     PERF_REVIEW_PERIOD     PERF_REVIEW_PERIOD_FREQUENCY     PERIOD_OF_SERVICE_ID     PROBATION_PERIOD     PROBATION_UNIT     SAL_REVIEW_PERIOD     SAL_REVIEW_PERIOD_FREQUENCY     SET_OF_BOOKS_ID     SOURCE_TYPE     TIME_NORMAL_FINISH     TIME_NORMAL_START     BARGAINING_UNIT_CODE     LABOUR_UNION_MEMBER_FLAG     HOURLY_SALARIED_CODE     REQUEST_ID     PROGRAM_APPLICATION_ID     PROGRAM_ID     PROGRAM_UPDATE_DATE     ASS_ATTRIBUTE_CATEGORY     ASS_ATTRIBUTE1     ASS_ATTRIBUTE2     ASS_ATTRIBUTE3     ASS_ATTRIBUTE4     ASS_ATTRIBUTE5     ASS_ATTRIBUTE6     ASS_ATTRIBUTE7     ASS_ATTRIBUTE8     ASS_ATTRIBUTE9     ASS_ATTRIBUTE10     ASS_ATTRIBUTE11     ASS_ATTRIBUTE12     ASS_ATTRIBUTE13     ASS_ATTRIBUTE14     ASS_ATTRIBUTE15     ASS_ATTRIBUTE16     ASS_ATTRIBUTE17     ASS_ATTRIBUTE18     ASS_ATTRIBUTE19     ASS_ATTRIBUTE20     ASS_ATTRIBUTE21     ASS_ATTRIBUTE22     ASS_ATTRIBUTE23     ASS_ATTRIBUTE24     ASS_ATTRIBUTE25     ASS_ATTRIBUTE26     ASS_ATTRIBUTE27     ASS_ATTRIBUTE28     ASS_ATTRIBUTE29     ASS_ATTRIBUTE30     LAST_UPDATE_DATE     LAST_UPDATED_BY     LAST_UPDATE_LOGIN     CREATED_BY     CREATION_DATE     TITLE     OBJECT_VERSION_NUMBER
    931510     7-Nov-08     31-Dec-12     122     (null)     (null)     (null)     3978     1     (null)     14402     (null)     220150     (null)     734956     (null)     (null)     476     (null)     (null)     (null)     (null)     2     E     Y     (null)     100035417-2     (null)     (null)     (null)     45948739     (null)     (null)     (null)     (null)     (null)     (null)     (null)     868007     (null)     (null)     (null)     (null)     449     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)                                        
    797386     26-Aug-08     26-Aug-08     122     (null)     (null)     (null)     3980     3     (null)     14402     (null)     218925     (null)     734956     (null)     (null)     476     (null)     (null)     (null)     (null)     1     E     Y     (null)     100035417     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     740071     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)                                        
    916076     26-Aug-08     31-Dec-12     122     (null)     (null)     (null)     3980     1     4     14402     (null)     218925     (null)     734956     (null)     (null)     476     (null)     (null)     (null)     (null)     1     B     Y     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)                                        
    797386     25-Feb-08     25-Aug-08     122     (null)     (null)     (null)     3980     1     (null)     14402     (null)     218925     (null)     734956     (null)     (null)     476     (null)     (null)     (null)     (null)     1     E     Y     (null)     100035417     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     740071     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)

  • How to find out no. of records or repeating frame in a page

    Hi All,
    How do I find out how many records have been displayed on a particular page?
    I'm having a repeating frame, and I want to know print another item, on a condition that if the records printed on the page are less than 5 then it should be printed otherwise not.
    The item to be printed is not a part of the repeating frame whoz occurences have to be counted.
    Regards
    Naveen

    Hi Naveen
    You can create a Packaged varaible that acts as
    global variable , and you can increment this
    variable in the repeating frames Format Trigger .
    Based on the value of the variable , you can
    return true or false for the item that you want to
    display .

  • How do I find out which programs of mine will not work with Mountain Lion?

    I recently upgraded to Lion and found that all of my Power PC based applications wouldn't work (much to my surprise, as no one at Apple told me this when I inquired about the upgrade, nor is it listed in the App Store). Had to get a whole new Microsoft Word suite - after the fact.
    Now, I just got an email from Intuit saying that if I upgrade to Mountain Lion I will probably have to upgrade to the latest and greatest version of Quickbooks (unless I create a partition, which is waaay too complicated for me). How do I find out what ELSE won't work if I upgrade to Mountain Lion?
    Mac OS X (10.5.8)

    Here's a compatibility guide by a 3rd party.  I can't attest to the accuracy.
    http://roaringapps.com/apps:table/tags/_a/index_tags/_a

  • How can I find out whether I will be charged for texting somebody who lives in Canada and I live in the US?

    How can I find out whether I will be charged for texting somebody who lives in Canada and I live in the US?

    If you are on a More Everything plan, International texting is included at no additional charge.
    If you are on any other plan, there will be a charge.
    From Verizon FAQ
    If you have The MORE Everything Plan, unlimited international text and multimedia messaging is included for no additional cost.
    For all other plans, you can find pricing, dialing and coverage information for a specific country on our International Messagingpage.

  • I wanna get my ipod touch 4g 8gb screen repaired. how can i find out how much it will cost?

    i wanna get my ipod touch 4g 8gb screen repaired. how can i find out how much it will cost? anyone know?

    Apple wil exchange your iPod for a refurbished one for $99.
    Apple - Support - iPod - Repair pricing
    For how see:
    Apple - Support - iPod - Service FAQ
    That is about the same price as a third-party place like this one.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • My MacBook Pro isn't a year old yet and would like to use iCloud. However, very apprehensive about Lion upgrade...how can I find out what I will lose if I upgrade?

    My MacBook Pro isn't a year old yet and would like to use iCloud. However, very apprehensive about Lion upgrade...how can I find out what I will lose if I upgrade?

    Ajimd33 wrote:
    I appreciate the prompt response.  Having read several threads, you can appreciate why I would be hesistant to upgrade to the Lion.  All I basically use is Office for Mac and the other basic functions such as email/calendar/address/contacts...etc. I have read horror stories about peoples stuff dissapearing into cyberspace and obvi dont want that to happen.
    That's all nonsense. Most people don't post anything if they don't have any problems. People who do have problems usually have very specific reasons for them that they have caused themselves.

  • How to I find out the photos SIZE in inches. It will give the the resolution

    How to I find out the photos SIZE in inches. It will give the the resolution of the image and the file size.

    In iPhoto, images don't have a size in inches until you use them. Until then it is just the pixel size. If you know the pixel size and resolution you calculate it this way:
    If the image size is 5184 x 3486 (like my Canon T3i, you divide the size in pixels by the resolution in pixels per inch to get the actual length, so for some common resolutions:
    Res Width Height
    --         5184     3486
    300      17.3      22.6  
    220       23.6     15.8
    72          72       48.4
    So, as you can see, iPhoto is probably correct in ignoring file size for most recent digital cameras. There is plenty of resolution for almost any size you want to print.

  • HT1420 how do i find out what computers have been authorizied for my account? My account shows 5 should only be 2 do iphones count?

    how do i find out what computers have been authorized for my account? I have had one stolen and one died but my account shows 5 pcs authorizied? how do i unauthorize a computer not in my hands?

    Iphones do not count. Computers only.
    There is no way to find out what computers.
    Deauthorize all, then authorize the active computers.

  • How do I find out when a release will be made containing fixes to known bugs?

    I'm currently using Firefox 22.0 which is part of Ubuntu Precise (12.04). I have not been able to find out when a release will be made containing fixes to known bugs in Firefox. How do I find out when a release will be made containing fixes to known bugs?

    For desktop
    * latest release<br/>http://www.mozilla.org/firefox/notes/
    * latest beta<br/>http://www.mozilla.org/firefox/beta/notes/
    * latest Aurora<br/>http://www.mozilla.org/firefox/aurora/notes/
    For mobile
    * latest release<br/>http://www.mozilla.org/mobile/notes/
    * latest beta<br/>http://www.mozilla.org/mobile/beta/notes/
    * latest Aurora<br/>http://www.mozilla.org/mobile/aurora/notes/

  • HT1498 How can I find out when a movie will be available for rent?

    How can I find out when a movie will be available for rent?

    You can't. A movie's only available for rental if the copyright holder allows that; nobody except for them and Apple would know when or if a specific movie will be.
    (102388)

  • How do i find out if my ipod will sync with cloud

    how do i find out if my ipod will sync with cloud

    An iPod Classic cannot sync with the Cloud. It can only sync with your computer as it has no WiFi capabilities. iCloud and devices was built for the iPod Touch, iPhone, and iPad.

  • How can I find out the overall time and not only the time of a single clip?

    I have set up two cameras in one room. Both cameras record the same thing from different perspectives at the same time. I have found an interesting scene for video 1 (recorded by camera 1). Now I would like to find the time at which the interesting scene takes place in video 2.
    However, I have not seen any way to get displayed, at what time the scene starts in relation to the total length of the video (e.g: scene starts after 5 minutes from total 10 minutes).
    The indicated time refers only to a part of the clip and not to the overall project, even if a special clip is not selected. Does anyone know, how I can find out the time?

    Go to Settings>iCloud>Storage & Backup.  It will be shown just below the Back Up Now button at the bottom.

Maybe you are looking for

  • Debug Code 04 60 55

    One day I turned off my computer which had been working perfectly and came back later that night and turned it on and it wouldnt post and would power cycle. So I RMAd the board and got another one two weeks later. I hooked everything up and now it wo

  • Can we show on a dashboard with a report if a discussion is ongoing?

    Hello, When using dashboards with lots of reports on it, it could be interesting to see if for a certain report a discussion is going on without having to open the discussion panel. For the moment I believe that this is not possible? Can someone help

  • Diskimagemounter program not working. HELP!

    When I download a .dmg file, the image tries to mount until i get a window that pops up saying device not configured. So, I've tried opening it with diskimagemounter (the default), disk utility, and a program called Mount which was a .app file, and i

  • How does one search the Store for IOS 4.21 only apps?

    Hi, I have FOUR iPod touch 2nd gens, with a max OS of IOS 4.21.   How do I search the Store for apps that will actually work on these devices? Thanks!

  • Ultrabeat logic express 8

    Hi there I recently posted a topic about logic express 8 drums and got no reply,maybe i should have mentioned ultrabeat Anyway i just want to assign channel strips to the drum parts i.e Kick main,snare 1/2 etc.On the ultrabeat interface i know how to