How to find this count...

Hi all,
I have two tables like this.
desc tp030_actl_mstr 
Name                         Type                                                                                                                        
PLN_YEAR_Y                 NUMBER(4)                                                                                                                                                                                                                                                                                                                                                   
CD_SITE_CODE          VARCHAR2(5)                                                                                                                                                                    
ACMT_ACTUAL_REF_R          VARCHAR2(6)
ACMT_ACT_EFF_Y             DATE                                                                                                                                                                                         
ACMT_ACT_ISSD_Y            DATE
desc tp031_actl_dtl
Name                         Type                                                                                                                        
PLN_YEAR_Y                 NUMBER(4)                                                                                                                                                                                                                                                                                                                                                   
CD_SITE_CODE               VARCHAR2(5)                                                                                                                                                                                                                                                                                                                                              
ACMT_ACTUAL_REF_R          VARCHAR2(6)
ACMT_ACT_EFF_Y             DATE                                                                                                                                                                                         
ACMT_ACT_ISSD_Y            DATE
ACDT_EST_AUG_VOL_Q         NUMBER(12)here so ACMT_ACTUAL_REF_R is link between these two tables..
and same ACMT_ACTUAL_REF_R are present in both tables...and child table will some additional information.
Now i need to find "which ACMT_ACTUAL_REF_R having multiple CD_SITE_CODE and its count and where ACMT_ACT_EFF_Y,ACMT_ACT_ISSD_Y is not null and
ACDT_EST_AUG_VOL_Q >0
any help will be appreciated..
Version 10G
Thanks &
Regards
asp

Hi, Asp,
You can use GROUP BY and HAVING, somethig like this:
SELECT       m.acmt_actual_ref_r
,       COUNT (*)          AS cnt
FROM       tp030_actl_mstr     m
JOIN       tp031_actl_dtl     d  ON     m.acmt_actual_ref_r     = d.acmt_actual_ref_r
WHERE       d.acmt_act_eff_y     IS NOT NULL
AND       d.acmt_act_issd_y     IS NOT NULL
AND       d.acdt_est_aug_col_q     > 0
GROUP BY  m.acmt_actual_ref_r
HAVING       COUNT (DISTINCT cd_site_code)     > 1
HAVING is like another WHERE clause, but WHERE is applied before the GROUP BY, and HAVING is done after it, so you can use aggregate functions (such as COUNT) in the HAVING clause.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
Explain how you get those results from that data.
Always say what version of Oracle you're using.

Similar Messages

  • How to find the count of attachments done before submit in Attachment Link?

    How to find the count of attachments done before submit in Attachment Link?
    Does anybody know how to find the count of attachments done in Attachment Link item type before Submit.
    My requiremet is to display the count of attachments done by user used in Standard Page before he submits the page.
    Any help would be appreciated.
    Thanks.
    CO.java
    OAMessageAttachmentLinkBean oalink = (OAMessageAttachmentLinkBean)webBean.findChildRecursive("Attachments");
    oalink. count ?

    I have the same issues! any body can help this issues?

  • I cant find my purchased ringtones on my itunes account? Anybody know how to find this? It's not popping up under Music in my purchased history. It is soooo frustrating because they make it so hard to find anything ringtone related on the itunes store!!!

    I cant find my purchased ringtones on my itunes account? Anybody know how to find this? It's not popping up under Music in my purchased history. It is soooo frustrating because they make it so hard to find anything ringtone related on the itunes store!!!

    They will be wherever you put them.
    You only get one download.

  • How to find the count of tables going for fts(full table scan in oracle 10g

    HI
    how to find the count of tables going for fts(full table scan) in oracle 10g
    regards

    Hi,
    Why do you want to 'find' those tables?
    Do you want to 'avoid FTS' on those tables?
    You provide little information here. (Perhaps you just migrated from 9i and having problems with certain queries now?)
    FTS is sometimes the fastest way to retrieve data, and sometimes an index scan is.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
    There's no 'FTS view' available, if you want to know what happens on your DB you need, like Anand already said, to trace sessions that 'worry you'.

  • How to find MATCH count for #  in a String

    Hi all,
    How to find MATCH count for #  in a String.
    Ex:  6170#0400-0002-00#API3PT#AL#AUST#DEVE#KG#100.00#100.00#100.00#0.00##10.20
    Regards,
    Balavardhan.K

    >
    balavardhan k wrote:
    > I have used below syntax to find count but it is not returning the value and SY-SUBRC  = 4.
    >
    >
    > Data : l_text type string.
    >
    > l_text = '6170#0400-0002-00#API3PT#AL#AUST#DEVE#KG#100.00#100.00#100.00#0.00##10.20'.
    >
    >
    > FIND ALL OCCURRENCES OF '#' IN L_TEXT MATCH COUNT mcnt .
    Then it's not a # but possible a horizontal tab-sign.
    Do a find on cl_abap_char_utilities=>horizontal_tab instead.
    Edited by: Maen Anachronos on Nov 23, 2010 2:48 PM

  • HT4061 Need to find MEID # on my ipad 2 (non-cellular) to use Verizon's wi-fi while on vacation.Can anyone explain to me how to find this number?   Thanks in advance .  Scott

    Need to find MEID # on my ipad 2 (non-cellular) to use Verizon's wi-fi while on vacation.Can anyone explain to me how to find this number?   Thanks in advance .  Scott

    iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number
    http://support.apple.com/kb/HT4061
     Cheers, Tom

  • My iPod was stolen and insurance company want it's serial number before replacing it. They have advised iTunes stores this information as a device connected to iTunes. Can anyone advise how I find this information?

    IiPod serial number stored in iTunes, can anyone advise how I find this information for my insurance company?

    Juliebathgate wrote:
    IiPod serial number stored in iTunes, can anyone advise how I find this information for my insurance company?
    Hi,
    If you have made a backup at any time of your iPod in iTunes, it should be in Preferences, under Devices tab.
    In iTunes
    Open iTunes Preferences.
    From the Preferences window click on the Devices.
    Once you are there you should see a list under "Device Backups:".
    Hover your mouse pointer to the device and in a little while it should display the serial number of the device (with an iPhone it will also display a phone number used with it and the IMEI code and with an iPad it will display the IMEI in addition to the serial number).
    A pircture of where it can be found: http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT4946/en_US/HT4946- devices-iphone-001-en.png

  • TS3694 how to find this solution?

    how i find this solution in iphone 3g .. i need help to recover this.

    The first step in finding a solution is to state the problem.

  • How to find this link

    Library -> Logistics -> Logistics Execution (LE) -> Transport (LE-TRA) -> Shipment Cost Processing -> Shipment Cost Processing with Service Providers -> Shipment Costs as Delivery Costs).
    How to find this above link.
    Please help me?
    How to connect to sap library
    With regards
    lakki

    Hi Lakki,
    Please go through this link it will help you,
    http://help.sap.com/saphelp_47x200/helpdata/en/93/74413b546011d1a7020000e829fd11/frameset.htm
    I hope it will help you,
    Regards,
    Murali.

  • How to find this Search object relavant to which root object?

    Hi All,
      how to find this Search object relavant to which root object?
      As I am having search object 'BTQuery1O', so which is root object for this?
      how to find this?

    Hi Carl,
               Search object BTQuery1O and the attribute structure associated with it is CRMST_QUERY1O_BTIL,
               even if we enhance this structure with zfield, as it is search object, then it should queried on some main database
               table, so it is 'CRMD_ORDERADM_H', here we need to add our zfield first to it, so that after added to search object then
               only search query work, so that's the reason I am asking is it possible to find 'CRMD_ORDERADM_H' relevant from
               GENIL_MODEL_BROWSER, or any way also?

  • HT1551 Want to play tv shows purchased on iPad on Apple tv. When I touch icon for apple tv and choose "apple tv" it asks for an apple tv password. We have never set up any password and can't get past this screen. Does anyone know how to find this password

    Want to play tv shows purchased on iPad on Apple tv. When I touch icon for apple tv and choose "apple tv" it asks for an apple tv password. We have never set up any password and can't get past this screen. Does anyone know how to find this password?

    You can remove the Airplay password from the Settings menu on your AppleTV.

  • I need a domain key for the icrop app. Any ideas on how to find this?

    I need a domain key for the icrop app. Any ideas on how to find this?

    Can you open the Preview program without loading a file, like by itself?
    If it doesn't load then I suspect a corrupt Preview preference file.
    Deleting the System Preference or other .plist file
    Can you open other files with Preview, like jpg's and images?
    How about other PDFs? or is it just that one you have downloaded?
    Run through this list of fixes
    Step by Step to fix your Mac

  • How to find this OSS note ?

    Hi,
    i have an issue in Tcode MR8M and i find the OSS note N° 182625 that propose a solution for it, but this solution concern previous releases (4.0B and 4.5B).
    our release is 5.0 so is it possible to excute this note in our system and what is the impact of that ?
    How to find the note concerning my release ?
    Please advise
    Regards.

    Hi,
    It's not possible to implement the note which refers to previous version of SAP; the system will reject this update. You can look for OSS by entering the error message number you are receiving and trying to see if there is relevant info.
    Regards,
    Eli

  • Trying to figure out how to find this error?

    Hi,
    I have a project that keeps throwing this error, but I can't see, to figure out how to find it:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    It's a very large project. How can I search for this?
    thanks,
    Dave

    ok, so it showed me a few things... THANKS, but none of which were exactly a problem:
    at ALeCard_CBP_0101_fla::MainTimeline/frame23()[ALeCard_CBP_0101_fla.MainTimeline::frame23:4 3]
    at flash.display::MovieClip/gotoAndPlay()
    at ALeCard_CBP_0101_fla::MainTimeline/fl_ClickToGoToScene2523()[ALeCard_CBP_0101_fla.MainTim eline::frame25:302]
    so the top one is just a part of a button
    downloadButton.buttonMode = true;
    which is fine.
    then, the other one points to a part of a function that I've used in a dozen other places and it works fine:
    MovieClip(this.root).gotoAndPlay(23);
    something I did find-and I still can't figure out why-is that download button was causing issues. I have NO idea why since it's an exact duplicate from another file.
    but this is cool to have this information-thanks!
    Dave

  • NEED HR KEY(HOW TO FIND THIS KEY)

    HI,
    I am working with EE 4.7 version, can i use this version for HR module.. will it be possible. DO i need to install any other softwares with this package.. I aslosa looking for the HR module key.. Could u please tel me where  to find this key in my PC.
                                          thanking you,

    Hello Jijay
    If the <i>software component</i> <b>SAP_HR</b> is installed on your SAP system then you have the HR module available. The dependencies between software components can be seen using transaction <b>SPAM</b>.
    For example, on ECC 5.0 SAPKE50004 (SP 04 for SAP_HR 5.0) requires
    - SAPKA64009 (SP 09 for SAP_ABA)
    - SAPKB64009 (SP 09 for SAP_BASIS)
    - SAPKE50003 (SP 03 for SAP_HR 5.0)
    - SAPKW35009 (SP 09 for SAP_BW 3.5)
    Regards
      Uwe

Maybe you are looking for

  • N73 and windows media player driver

    hi everyone, im having a problem installing the windows media player driver off the disc for the n73 it installs everything else but fails to install that anyone know where i can down load a copy.? ive got: pc suite 6.83 windows xp service pack 2 win

  • IPhoto Update Gliche

    I have just downloaded and installed the new Iphoto update, all 1.2gb of it, yet the Mac store still shows it as an update available, even theough the little grey box says that it is already installed. Support has told me to clear the Updated Folder

  • WEB server doesn't start after php5 install failed

    Hi, Running a PPC G4 with osx server 10.3.9 I tried to install entropy php 5.1.6 on my server but it failed and said it could not complete the install. After that my web service stopped and I can't turn it on anymore. Please HELP ! I can't reinstall

  • All My Apple Apps won't launch - my others like Firefox, Adobe CS do????

    I have a 512meg G4 iMac with around 7gig HD space free. All my Apple programs refuse to launch, or launch and then hang (apart from iDVD). I though of setting up a new user but as soon as I click on Users in Prefs its the spinning beachball of death.

  • Reports ---- Form calling on Web (Pay Attention : Oracle Team)

    Hi, we are trying to call form from Report in Drill Down Report we are working on Client/Server system. Please help . We can call form FROM Report on MS Windows platform by using App.Begin Routine but we are unable to do so on web. srw.set_hyperlink