SQL issue with with/without where cluase have some data issue

Hi,
I have an issue with the below sql. when I apply org filter for certain organization it's not returning the result but when I remove the filter that particular organization appears in the result. Can someone help to identify the cause for that. appreciate for your help.
the filter I tried with AND T116391.ORG_HIER11_NAME                             = 'IT Hosting Services'
SELECT DISTINCT T116391.ORG_HIER11_NAME
FROM WC_TLNT_READINESS_D T310261
/* Dim_WC_TLNT_READINESS_D */
WC_TLNT_RETENTION_RISK_D T308248
/* Dim_WC_TLNT_RETENTION_RISK_D */
WC_TLNT_LOSS_IMPACT_D T308236
/* Dim_WC_TLNT_LOSS_IMPACT_D */
WC_TLNT_EMPLOYEE_D T308163
/* Dim_WC_TLNT_EMPLOYEE_D */
W_POSITION_DH T116081
/* Dim_W_POSITION_DH_Position_Hierarchy */
W_EMPLOYEE_D T115519
/* Dim_W_EMPLOYEE_D_Supervisor */
W_JOB_D T95865
/* Dim_W_JOB_D */
W_EMPLOYEE_D T68497
/* Dim_W_EMPLOYEE_D */
WC_ROWLVL_SECURITY_D T310120
/* DIM_WC_ROWLVL_SECURITY_D */
W_DAY_D T66755
/* Dim_W_DAY_D_Common */
W_INT_ORG_D T111939
/* Dim_W_INT_ORG_D_Employee_Org */
WC_TLNT_F T308187
/* Fact_WC_TLNT_F */
WC_TLNT_RSLTS_POTENTIAL_D T308263
/* Dim_WC_TLNT_RSLTS_POTENTIAL_D */
W_PAY_GRADE_D T95908
/* Dim_W_PAY_GRADE_D */
WC_ORG_LIST_D T304800
/* Dim_WC_ORG_LIST_D_OrgSecurity */
W_INT_ORG_DH T116391
/* Dim_W_INT_ORG_DH_Employee_Org */
WHERE ( T308187.LOSS_IMPACT_WID = T308236.ROW_WID
AND T308163.ROW_WID = T308187.TLNT_EMPLOYEE_WID
AND T116081.ROW_WID = T308187.EMP_POSTN_DH_WID
AND T115519.ROW_WID = T308187.SUPERVISOR_WID
AND T95865.ROW_WID = T308187.JOB_WID
AND T308187.RETENTION_RISK_WID = T308248.ROW_WID
AND T66755.X_REVIEW_YEAR_WID = T308187.REVIEW_YEAR_WID
AND T68497.ROW_WID = T308187.EMPLOYEE_WID
AND T68497.X_PAY_GRADE_WID = T95908.ROW_WID
AND T68497.X_I_POPULATION_GROUP = T310120.I_POPULATION_GROUP
AND T308187.RSLTS_POTENTIAL_WID = T308263.ROW_WID
AND T95908.ROW_WID = T308187.PAY_GRADE_WID
AND T111939.ROW_WID = T308187.HR_ORG_WID
AND T111939.ORG_NUM = T304800.ORGANIZATION_ID
AND T116391.ORG_WID = T308187.HR_ORG_WID
AND T116391.BASE_ORG_NUM = T304800.ORGANIZATION_ID
AND T66755.DAY_DT = TO_DATE('2012-07-10 00:00:00' , 'YYYY-MM-DD HH24:MI:SS')
AND T116391.ORG_HIER11_NAME                             = 'IT Hosting Services'
AND T308187.READINESS_WID = T310261.ROW_WID
AND T308263.RESULTS_POTENTIAL = 'Strong Potential'
AND T310120.ALLOWED = 'Y'
AND T310120.ROW_Secuirty_GROUP = 'Corporate Full Data Access'
AND CAST(T66755.X_REVIEW_YEAR_WID AS CHARACTER ( 30 ) ) = '2012'
AND CAST(T308187.REVIEW_YEAR_WID AS CHARACTER ( 30 ) ) = '2012'
AND (T111939.HR_ORG_FLG IN ('U', 'Y'))
AND (T116391.ROW_WID IN (0)
OR T116391.W_HIERARCHY_CLASS IN ('HR-ORG'))
AND (T116391.ROW_WID IN (0)
OR T116391.HR_ORG_FLG IN ('Y'))
AND (T116391.ROW_WID IN (0)
OR T304800.SECURITY_PROFILE_ID IN (-1))
AND (T111939.HR_ORG_FLG IN ('Y')
OR T304800.SECURITY_PROFILE_ID IN (-1))
AND (T116391.ROW_WID IN (0)
OR T116391.CURRENT_VER_HIER_FLG IN ('Y'))
AND (T116081.CURRENT_LVL1ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL2ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL3ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL4ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL5ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL6ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL7ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL8ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_TOP_LVL_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL15ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL14ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL9ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL16ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL11ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL10ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL13ANC_LOGIN IN ('N0004404')
OR T116081.CURRENT_LVL12ANC_LOGIN IN ('N0004404')) )
order by T116391.ORG_HIER11_NAME desc
Thanks
Jay
Edited by: Jay on Jul 10, 2012 7:51 AM

How to ask question
SQL and PL/SQL FAQ
Handle:     Jay
Status Level:     Journeyer (280)
Registered:     Aug 6, 2010
Total Posts:     350
Total Questions:     61 (45 unresolved)
REALLY?

Similar Messages

  • I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • With the latest update, i have some trouble with youtube. Every videos that i watch are shaking. Is there something to fix it?

    With the latest update, i have some trouble with youtube. Every videos that i watch are shaking. Is there something to fix it?

    Instantly worked, found this on other thread!!
    1. System Preferences >  Flash Player > Advanced >  Delete  All
         Press the "Delete All" button
    2. Safari > Preferences > Privacy
        Press the button “ Remove All Website Data”.
    *Dont forget to restart Safari

  • With Panorama/TabCandy, when you have some "App Tabs" isolated into a group then open a normal tabs included into antoher group. Clicking on an "App Tab" makes the normal tabs disappear.

    With Panorama/TabCandy, when you have some "App Tabs" isolated into a group then open a normal tabs included into antoher group. Clicking on an "App Tab" on the navigation bar makes the normal tabs disappear from this bar.

    Panorama/TabCandy is in an early stage of development and has many open bug reports. One area that is being discussed is how App Tabs should be integrated into TabCandy, not surprisingly there are varying opinions.

  • IOS  Developer Enterprise Program:  Can I have a discussion with an Apple Representitive, I have some questions.

    My Company is interested in distributing apps through our existing web portal within our organization. Can I have a discussion with an Apple Representitive, I have some questions?

    https://developer.apple.com/contact/
    Regards.

  • HT203433 my issue is that my itunes store have some problem i cannot update my app and i also purchase app or download free app on it . it keep on tell me that ;an unknown error occured (0x800b0101)

    my issue is that my itunes store have some probleme i cannot update my app and purchase app or download free app also it keep on tell me that an unknownerror occured (0x800b0101)

    You could try this.
    Back up all data.Triple-click anywhere in the line below on this page to select it:
    /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
    Right-click or control-click the line and select
    Services ▹ Reveal
    from the contextual menu.* A folder should open with an item selected. Move the selected item to the Trash. You may be prompted for your administrator login password. Reboot and test. If there's no change, restore the item you deleted from a backup, overwriting the one that may have been created in its place. Otherwise, you may need to recreate some of your settings in the Network preference pane.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.
    Credit for this solution to ASC member luis.pinhor.

  • HT1688 I have an iPhone5, my boyfriend has a Motorola AndroidX. I can send him text messages no problem, but if he sends me one, with or without pictures, it never somes through. I have to do a "hard" shutdown on my phone in order to retrieve his text and

    Help, I ehave iphone5, boyfriend has Motorola Android, I can send him texts, with and without photos, he receives them right away.  When he sends me a text, with or without pictures, I get nothing until I do a hard shutdown of my phone and when it comes back on, messages older than 4-5 hours pop up.  Sometimes they don't arrive at all and he is forcecd to use email.
    Please tell me how to fix this problem.  I have gone through Technical Support many, many times, resetting networks etc., trouble with voicemail, now getting text messages "blank" from Unknown.  AT&T says it is there software problem.  I have had so many problems since receiving this phone, on-going daily calls to AT&T.
    Can anyone out there help me with the issue of being able to receive text messages from my boyfriends Anroid?
    I can so use your help desperately.
    Thanks,
    Kathy Vega

    There are a lot of posts in the forums today with people having problems with iMessage.   There was also a published outage yesterday, so it's possible there are still some issues that may be impacting you both.
    I would just wait it out - I'm sure it will be sorted out soon.

  • If I buy an iPad4 with Verizon cellular where I have my cell phone

    where I have my cell phone and then I decide when my contract is up to change carriers, will the iPad be able to change, too? Or am I stuck with Verizon as long as I own this particular iPad? Thanks!

        Hi houseofrefuge
    GReat question! You can use your android as a hotspot. This will allow your new tablet to get on the internet. Or you can purchase one from us and add it to your plan. See all of our devices here: http://bit.ly/nD0WuY
    JoeL_VZW
    Follow us on Twitter @VZWSupport

  • Has anyone with sprint have time/date issues as well as imessage function automatically turning itself off?

    has anyone with sprint had time/date issues as well as imessage function automatically turn itself off?

    Im having the same problem, I updated my Iphone 4S to 6.1.3, shortly after that my phone had no audio. It was working fine one minute and then stopped. Was listening to music when sound gave out on me. It wont ring, phone just vibrates even after turning off vibration option. I've tried all the options listed and nothing. My phone has never been jailbroken either. If I connect the earphones is works perfectly. On one of my last calls received, phone's ringtone was heard for about 2 seconds before muting and just vibrating. Ringtone sounded perfect, speakers did not sound damaged. 
    What else could be done? I've read several post regarding this and it seems like Apple has no solution to this yet. Very dissappointed.

  • Group by with and without where clause

    Do I need to use these two inner views to show results by group by as one line? Can I achieve the same result without typing the same select statement two times since these two SELECT statements differ only in where clause. This query is a simulation. My actual query is longer. My expectation is to make this query shorter (without inner views).
    with tmp as (
    select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual UNION ALL
    select 'COMPLETE' status, 'GERMANY' country, 1 substatus FROM dual UNION ALL
    select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual)
    select v1.status, v1.country, v1.cnt01, v2.cntIncluding0 from
    (select status, country, count(*) cnt01 from tmp tmp1 group by status, country) v1
    JOIN
    (select status, country, count(*) cntIncluding0 from tmp tmp2 where substatus=0 group by status, country) v2
    on v1.status=v2.status and v1.country=v2.country;

    totalnewby wrote:
    Do I need to use these two inner views to show results by group by as one line? Can I achieve the same result without typing the same select statement two times since these two SELECT statements differ only in where clause. This query is a simulation. My actual query is longer. My expectation is to make this query shorter (without inner views).
    with tmp as (
    select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual UNION ALL
    select 'COMPLETE' status, 'GERMANY' country, 1 substatus FROM dual UNION ALL
    select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual)
    select v1.status, v1.country, v1.cnt01, v2.cntIncluding0 from
    (select status, country, count(*) cnt01 from tmp tmp1 group by status, country) v1
    JOIN
    (select status, country, count(*) cntIncluding0 from tmp tmp2 where substatus=0 group by status, country) v2
    on v1.status=v2.status and v1.country=v2.country;
    SQL> with tmp as
      2  (
      3  select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual UNION ALL
      4  select 'COMPLETE' status, 'GERMANY' country, 1 substatus FROM dual UNION ALL
      5  select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual
      6  )
      7  select status,
      8         country,
      9         count(substatus) cnt01,
    10         sum(decode(substatus, 0, 1, 0)) cntincluding0
    11    from tmp
    12   group by status, country
    13  ;
    STATUS   COUNTRY      CNT01 CNTINCLUDING0
    COMPLETE GERMANY          3             2

  • Problem with prepared statement where cluase when passing string value.Help

    I am updating a table using the following code. I am using string parameter in where clause. if I use Long parameter in where clause with ps.setLong , this code is working. Is there any special way to pass string value? Am I doing anything wrong?
    ===================
    updateMPSQL.append("UPDATE MP_Table SET ");
         updateMPSQL.append("MPRqmt = ?,End_Dt = ? ");
              updateMPSQL.append("where POS = ? ");
              System.out.println(updateMPSQL.toString());
              con     = getConnection(false) ;
              ps      = con.prepareStatement(updateMPSQL.toString());
              ps.setLong(1,MPB.getMPRqmt());
              ps.setDate(2,MPB.getEnd_Dt());
              ps.setString(3,MPB.getPos());
    result = ps.execute();
              System.out.println("Result : " + result);
    ==========
    Please help me.
    Thanks in advance.
    Regards,
    Sekhar

    doesn't Pos look like a number rather than a string variable?
    if I use Long
    parameter in where clause with ps.setLong , this code
    is working.
    updateMPSQL.append("where POS = ? ");
    ps.setString(3,MPB.getPos());

  • With the 7.2 update, neither NHL or MLB recognize my location and are not allowing me to access content. Worked through troubleshooting with MLB for an hour with no resolution. They have elevated the issue. Is this an error in the 7.2 update?

    After updating Apple TV to 7..2, neither NHL or MLB TV recognize my location and  will not let me access content.  They say I am in a blackout local market, but I am not. Troubleshooting with MLB was unable to resolve the issue and it has been elevated there. Any thoughts on how to resolve?

    After updating Apple TV to 7..2, neither NHL or MLB TV recognize my location and  will not let me access content.  They say I am in a blackout local market, but I am not. Troubleshooting with MLB was unable to resolve the issue and it has been elevated there. Any thoughts on how to resolve?

  • IF WE NEED HELP WITH THE SCRIPTING WHERE WE HAVE TO SEND AN EMAIL OR POST THE QUESTION?ONLY HERE?

    For UCCX 9.X Version
    Regards
    chrysostomos

    YES, ACTUALLY, THIS IS A GOOD PLACE TO POST QUESTIONS ABOUT UCCX SCRIPTING BUT PLEASE STOP SHOUTING UNLESS YOU REALLY, REALLY MEAN IT.
    G.

  • It looks like the way forward is to delete any apps you are having problems with and reinstall hopefully you have your data on iCloud this seems to work

    Looks like deleting and reinstalling the apps your having the problems with works in some cases

    Hi Flash, Just some info to correct yours. First, not everyone is having a problem with FP 10.1 and there are solutions and reverting to FP 10.0 would not be the first choice. If that was for you, that's fine. If you would read the many many threads here, you would find correct information for users that want to revert back to FP10.
    Also may I suggest you read up on Firefox version 3.6.6 as this is involved sometimes with FP 10.1.
    Lastly, I think it is always better to find out what a user's issues are before offering a solution. Reverting back to FP 10.0 is not for everyone that is having a problem nor should it be.
    If your instructions solved whatever problem you were having, that's great. However, to recommend this to other users that come here for help without knowing what their problems are may not be the best advice, in my opinion.
    There are many other details in the Uninstall Instructions and also the Install Instructions that need to be followed.
    That is why it is better for each user to have their own thread and receive help for their individual issues. This is also based on their computer system configuration.
    Believe me, if there was one fix for all FP 10.1 or any other version issues, it would be posted
    Thanks,
    eidnolb

  • It appears that the content of news articles is not showing up when I load them. The sites where I have had the issue are Reuters, Financial Post Canada.

    When I click on the article, the body text of the article does not show up. The hyper links in the article do show up. and also on the home page for the National Post - http://www.nationalpost.com/ (error in my initial question, it is not the Financial post), the articles on the home page only show the headlines etc.

    Try deleting your hotmail account and then adding it back as an Outlook account instead of "other". It worked for me.

Maybe you are looking for

  • Multiple logins/passwords possible for one site under one profile?

    I have three user log-ins at one site (personal, work, and volunteer group). Is it possible to get FF to remember all three pairs of log-ins/passwords under one profile? When I try to set the password for the second log-in, it changes the stored pass

  • Viewing photos an apple tv from mac

    I just bought apple TV. All my photos are sorted in folders in Lightroom. The photos in my picture folder are not in folders. On Apple TV I can only access "photos" which goes directly to my picture folder. How can I access my Lightroom Folders on Ap

  • Error message after loading newest version of itunes

    error message states "Some of the items in the iTunes library were not copied because you are not authorized to play them on this computer" What does this mean? I purchased those items and now they will not load on my ipod. This only started happenin

  • 10.4.11 update issues

    Last night, I got my automatic software update on my iBook G4 and downloaded a few different upgrades, including the newest Mac OS-X update for Tiger. After restarting my computer, I simply got the blue screen with the apple and the little wheel icon

  • I don't see turn off when I try to reset iPad.

    Before when I reset my iPad I usually see the slide to turn off key, but now I don't. i just wondered why. I'm using ios 6 now. Is that part of its update?