Results showing mismatch with same query

Hi,
The below query results in different fashion, when i use for one Panelist_Id it gives 13 records, and when i pull the whole record set it give only 5 records for the same
Panelist_id.
Here are queries:
select row_number() over (partition by panelist_id order by start_media_day) seq_ctr
, panelist_id
, start_media_day
, end_media_day
, ((end_media_day -start_media_day )+ 1) no_of_days
from (
select panelist_id
, media_day start_media_day
, lead(media_day) over (partition by panelist_id order by panelist_id, media_day) end_media_day
, day_diff
from (
select panelist_id
, media_day
, day_diff
, lag(day_diff) over(partition by panelist_id order by panelist_id,media_day) p_status
from (SELECT panelist_id,
MEDIA_DAY,
Case When LEAD (MEDIA_DAY, 1, 0)
OVER (PARTITION BY panelist_id ORDER BY QE_CODE ASC NULLS LAST)
- MEDIA_DAY < 0 THEN 9999 ELSE
LEAD (MEDIA_DAY, 1, 0)
OVER (PARTITION BY panelist_id ORDER BY QE_CODE ASC NULLS LAST)
- MEDIA_DAY END
DAY_DIFF
FROM PPMDP_QUALEDITS
WHERE QE_CODE = 'MISS' AND PANELIST_ID='1539620-6'
where day_diff > 1
or p_status is null
or p_status > 1
where day_diff = 1
---------------------------------------------------------------------------------------------------------------------Results 13 records.
select row_number() over (partition by panelist_id order by start_media_day) seq_ctr
, panelist_id
, start_media_day
, end_media_day
, ((end_media_day -start_media_day )+ 1) no_of_days
from (
select panelist_id
, media_day start_media_day
, lead(media_day) over (partition by panelist_id order by panelist_id, media_day) end_media_day
, day_diff
from (
select panelist_id
, media_day
, day_diff
, lag(day_diff) over(partition by panelist_id order by panelist_id,media_day) p_status
from (SELECT panelist_id,
MEDIA_DAY,
Case When LEAD (MEDIA_DAY, 1, 0)
OVER (PARTITION BY panelist_id ORDER BY QE_CODE ASC NULLS LAST)
- MEDIA_DAY < 0 THEN 9999 ELSE
LEAD (MEDIA_DAY, 1, 0)
OVER (PARTITION BY panelist_id ORDER BY QE_CODE ASC NULLS LAST)
- MEDIA_DAY END
DAY_DIFF
FROM PPMDP_QUALEDITS
WHERE QE_CODE = 'MISS' /*AND PANELIST_ID='1539620-6'*/
where day_diff > 1
or p_status is null
or p_status > 1
where day_diff = 1
---------------------------------------------------------------------------------------------------------------------Results 150000+ records.
And when I look for PANELIST_ID='1539620-6' from this 150000+ records it resulted 5 records.
Can someone help in getting where the error is?
Many thanks in advance.
Regards,
Sriniwas Gutti
Edited by: guttis on Oct 26, 2009 8:48 PM

Hi,
The below query results in different fashion, when i use for one Panelist_Id it gives 13 records, and when i pull the whole record set it give only 5 records for the same Panelist_id.
Here are queries:
select row_number() over (partition by panelist_id order by start_media_day) seq_ctr
, panelist_id
, start_media_day
, end_media_day
, ((end_media_day -start_media_day )+ 1) no_of_days
from (
select panelist_id
, media_day start_media_day
, lead(media_day) over (partition by panelist_id order by panelist_id, media_day) end_media_day
, day_diff
from (
select panelist_id
, media_day
, day_diff
, lag(day_diff) over(partition by panelist_id order by panelist_id,media_day) p_status
from (SELECT panelist_id,
MEDIA_DAY,
Case When LEAD (MEDIA_DAY, 1, 0)
OVER (PARTITION BY panelist_id ORDER BY QE_CODE ASC NULLS LAST)
- MEDIA_DAY < 0 THEN 9999 ELSE
LEAD (MEDIA_DAY, 1, 0)
OVER (PARTITION BY panelist_id ORDER BY QE_CODE ASC NULLS LAST)
- MEDIA_DAY END
DAY_DIFF
FROM PPMDP_QUALEDITS
WHERE QE_CODE = 'MISS' AND PANELIST_ID='1539620-6'
where day_diff > 1
or p_status is null
or p_status > 1
where day_diff = 1
---------------------------------------------------------------------------------------------------------------------Results 13 records.
select row_number() over (partition by panelist_id order by start_media_day) seq_ctr
, panelist_id
, start_media_day
, end_media_day
, ((end_media_day -start_media_day )+ 1) no_of_days
from (
select panelist_id
, media_day start_media_day
, lead(media_day) over (partition by panelist_id order by panelist_id, media_day) end_media_day
, day_diff
from (
select panelist_id
, media_day
, day_diff
, lag(day_diff) over(partition by panelist_id order by panelist_id,media_day) p_status
from (SELECT panelist_id,
MEDIA_DAY,
Case When LEAD (MEDIA_DAY, 1, 0)
OVER (PARTITION BY panelist_id ORDER BY QE_CODE ASC NULLS LAST)
- MEDIA_DAY < 0 THEN 9999 ELSE
LEAD (MEDIA_DAY, 1, 0)
OVER (PARTITION BY panelist_id ORDER BY QE_CODE ASC NULLS LAST)
- MEDIA_DAY END
DAY_DIFF
FROM PPMDP_QUALEDITS
WHERE QE_CODE = 'MISS' /*AND PANELIST_ID='1539620-6'*/
where day_diff > 1
or p_status is null
or p_status > 1
where day_diff = 1
---------------------------------------------------------------------------------------------------------------------Results 150000+ records.
And when I look for PANELIST_ID='1539620-6' from this 150000+ records it resulted 5 records.
Can someone help in getting where the error is?
Many thanks in advance.
Regards,
Sriniwas Gutti

Similar Messages

  • Wep app search result show on the same product page(product large view).

    I tried the web app search result show on the same product page.
    e.g checking the postcode which built as web app on the product page, to check availability to ship the user's area.
    so the result show on the same page(doesn't necessary to lose the product page), however the web app result doesn't show on the same product page.
    There is only way i know is to link another page.
    Anyone has done?

    I have done something similar with simple jquery, by loading the results page within a div placed inside the details template.
    By doing this I solved all my needs. In your case will work too as long as you only need to show information.

  • Browser response time slow but Analyzer fast with same query

    Hi all,
    We have a very complex query (structures and cell formulas).  When I drill and filter on a specific characteristic the action takes anything between 7 and 15 minutes when using the browser. The same query in Analyzer performing the same drilling action takes less than 35 seconds.
    Our architecture is as follows:
    - Relevant cubes are indexed on BWA
    - WebDynPro for Java
    We can see that the BWA is hit for a short time then the CPU utilization is back to 0%.  When doing '&profiling=x' on the browser I can see that the most of the time is spent on 'Get result set' / 'Get provider result set' for the Java events and on the OLAP side most time is spent on the 'Get result set' event.
    Interestingly enough - when disabling myself as a user for BIA use (NO_BIA_USE) in my user profile I get the same response time on the browser.
    So, does anyone have an idea of what may be the cause of the slow response time when using the browser?
    Thanks
    Edited by: Cobus van Rooyen on May 10, 2010 8:49 PM

    Hi,
    The reason is most likely because of the event ID 3200 where data transfer takes place from OLAP to frontend browser.
    Record a RSTT trace for this and if you are able to see frequent calls to "Apply State XML" and "Get Result Set" then apply the SAP Note 1428850. Otherwise see which function module is causing an error.
    If trace runtime is less but in browser still it takes long time then this might be because of the compression of HTPP responses, which can be confirmed by observing the sent and received data volumns from the HTTP server requests/responses. For more information refer SAP Note 746666.
    Imran...

  • I used to be able to search a subject and have the "results" show up with a new tab, but now it opens the result in the same tab, how do I fix this?

    I have tried repeatedly to get the options section to show how to do this but everything changed with the "new-and-improved(?)" Mozilla!
    Could someone please explain to me how to get this to work like it used to (open search results or links in a new tab)??? PLEASE, it is driving me nuts since my slow @ssed computer and AT&T (should be AS&S without the &) internet, makes me remember the bad old days of the 286 computer load times:
    Down memory lane...
    Power button on ==> go take a Shower, Shave, and the other S ==> Make coffee ==> enable program in command line (pre-windows) ==> fix breakfast and another coffee cup ==> curse at computer because it made you forget to add another switch to your command line...
    How many remember those days?!
    They say laughter is the best medicine, except I'm not laughing about the new Mozilla anymore :(

    Could you clarify where you are doing your search?
    ''For Firefox's "Search bar",'' which is the box on the right end of the main navigation toolbar with the icon indicating your currently selected search engine, there is a hidden setting for this:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''sear''' and pause while the list is filtered
    (3) Double-click the '''browser.search.openintab''' preference to switch it from false to true.
    If you test, does it work?
    ''For searches from other places,'' could you be more specific about where you are entering your query (e.g., address bar, built-in home page, on a search engine site)?

  • Different Ordered Result-Sets With Same Query.

    I am executing a very simple query which returns a name and an id. It is order by name preaty simple.
    BUT. returs different if the framework is english or french.
    <?xml version="1.0" standalone="yes"?>
    <NewDataSet>
    <Table>
    <DATAUNITID>11920</DATAUNITID>
    <NAME>(FR) Atlantis</NAME>
    </Table>
    <Table>
    <DATAUNITID>11922</DATAUNITID>
    <NAME>(FR) Beaumont</NAME>
    </Table>...
    ========================================================
    <?xml version="1.0" standalone="yes"?>
    <NewDataSet>
    <Table>
    <DATAUNITID>12006</DATAUNITID>
    <NAME>AVRANCHES</NAME>
    </Table>
    <Table>
    <DATAUNITID>12005</DATAUNITID>
    <NAME>CARENTAN</NAME>
    </Table>
    Any thoughts?
    Thanks in advance,
    Frank

    Hi Satria,
    You can detach the query in Bex analyser.
    Once you open the workbook, right click context menu,
    has the option to delete the query from work book.
    The query can be reinserted again.
    However a better solution would be to make the format changes in the workbook properties and save the changes.
    Regards,
    Nitin

  • Inconsistent results returned from the same query

    Hi,
    My company has a oracle 8i DB as backend for the website it is currently hosting. I wrote a plain SQL select query to retrive results from a table. Usually the query returns 50 to 100 records. We build an xml based on the results and cache the xml for subsequent user hits.
    But atleast once or twice a day we get a problem where it returns almost no records. So the resulting xml will be blank and from there on until we delete the cached xml the user sees the page as blank.
    I wonder why this happens, does this happen because of more hits to the oracle database?. Or is it because of the indexes created on the table?. Is oracle not able to handle multiple user requests?. We get mostly like 10 to 20 people clicking at the same time. I don't know what is causing the failure.
    Does any of you have this inconsistency problems with Oracle?
    Thanks in advance
    sony

    Please ask questions on Oracle Text (formerly InterMedia text) in the Oracle Text forum, you will get a quicker, more expert answer there.

  • Finder search results show MP3s with incomplete or changed filenames in Yosemite

    Under Yosemite, when performing a search for "mp3" in Finder, certain search results will not display their true filename under the "Name" column:
    For example, the "Name" column above should display the entire filename (as shown in the Status Bar), not just what I can only assume is the track title.
    This does not apply to all mp3s, only to some. Probably something to do with ID3 tags, or perhaps with certain hyphen usage in the filename.
    Anyway, I'd just like the "Name" column to show me the filename as it should, and not metadata. I can't find how to change the results to display the correct filenames.
    This causes several problems. First it makes sorting by an album's track number, which is frequently included in the actual filename, in the search results impossible, as now the numbers are not part of the list. Therefore if I want to drag an album into an iTunes Playlist in the correct album order I have to go to the source folder and can't do it straight from the search window. Also I can't see separate versions of the same song, which may have the same track title but different filenames. Also I can't see the filename at a glance, which may include other important information other than the track title. And so on.
    I can't find anyone else who has this problem on Yosemite. Mavericks yes... and sadly no help. Hoping it's fixable.

    I have the same problem with AIFF's too...
    It's a big problem for me as I'm currently doing some sound design.
    I need to see the file name in the finder, not the title/track name.

  • SQL Explain differs with same query

    DB 1: Oracle EE 11gR1 64-bit
    DB 2: Oracle XE 11gR2 64-bit
    Both on OEL 64-bit
    DB 1 does not do a SORT related to the subquery whereas DB 2 does do a SORT. Otherwise EXPLAN PLAN identical. But performance on DB 2 noticeably faster.
    Here is the SQL:
    select col4
    from tab1 join tab2 on tab1.col1 = tab2.col1
    where tab2.col3 = (select max(col3) from tab3);
    Explain plan (brief)
    DB 2:
    FILTER-
    HASH JOIN
    SORT
    DB 1:
    FILTER
    HASH JOIN
    Any hints (no pun) on what might cause this to occur? Is the optimizer different from XE 11gR4 and EE 11gR1 (wouldn't think so)? Or is it a parameter setting, memory or temp space (default settings apply for both DBs).
    Thanks

    Yes, the optimizer is different in 11gR2 than 11gR1. Also the optimizer in Enterprise Edition will have more choices available than in XE (partitioning, for example; parallel processing, since XE uses only 1 CPU), but in this case I doubt the difference is that deep.
    Besides optimizer differences, you need to consider these questions first when you see different plans:
    Is the volume of data the same in both databases?
    Are statistics up to date in both databases?
    Are statistics gathered the same way in each database?
    For anything more specific we need to see the 4-digit oracle version for each database, exact explain plans (copy-paste), and possibly some CREATE TABLE and INSERT statements if someone wants to reproduce what you are seeing in their database.

  • Dont show fields with same value as previous row.

    Hi, If I have a table like this:
    DEPNO_MONTH__COST__ID
    10_____ Jan______100___ 2
    10_____ Jan______200___ 4
    10_____ Jan_______50____3
    20_____ Feb______30____4
    30_____ Jan ______30____5
    30_____ Feb______40____6
    I need a select that shows the table like this:
    DEPNO_MONTH_COST_ID
    10______Jan_____100___2
    ________________200___4
    ________________50____3
    20______Feb_____30____4
    30______Jan_____30____5
    ________Feb_____40____6
    Can someone please help me? (ingore underscore)
    /Sören

    like this ?
    SQL> select decode(rno1, 1, depno, null) depno,
      2         decode(rno2, 1, mon, null) month,
      3         cost, id
      4    from (select depno,
      5                 mon,
      6                row_number() over (partition by depno order by  depno, mon, cost ) rno1,
      7                row_number() over (partition by depno, mon order by  depno, mon, cost ) rno2,
      8                cost, id
      9           from t1
    10         order by depno, mon, cost );
         DEPNO MONTH            COST         ID
            10 Jan                50          3
                                 100          2
                                 200          4
            20 Feb                30          4
            30 Feb                40          6
               Jan                30          5
    6 rows selected.
    SQL>
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Deleted iPod Playlist but iTunes shows iPod with same capacity as before!

    Hi!
    Can you help out? I wanted to free up some space on my iPod, so I deleted one of my Playlists through iTunes, however, although the Playlist has successfully been erased, shown capacity has not! The playlist was ~2.5GB, but my iPod's capacity meter has not changed at all!!
    What's up?! I would love the extra capacity please (my iPod nano 2G is the 8GB version)!!
    Thanks & looking forward to your reply.
    Stefan

    Indeed you deleted the playlist but not the songs... you can check on the "Music" tab that all the songs remain in your ipod... if you want to delete songs you have to do it from this "Music" tab... deleting the playlist doesn't delete the songs inside

  • How can I show all the results returned by a sql query?

    Hi guys,
    I need your help.
    Let's say I have one table: TableA. Fields of TableA are aleg, anon, apes. The following sentence can return, in general, several rows: select anon from TableA where aleg = somevalue. I'd like to show the result of column anon but no luck. If I try to show the results in a TextArea and the origin is an sql query only shows the first row value. I tried Show as: show as text (based in PLSQL) and coding an anonymous plsql block as
    DECLARE
    v_anon TableA.anon%TYPE;
    CURSOR v_cur IS
         select anon from TableA where aleg = somevalue;
    BEGIN
    OPEN v_cur;
    LOOP
    FETCH v_cur INTO v_anon;
    EXIT WHEN v_cur%NOTFOUND;
    :FIELD_IN_FORM := v_anon;
    END LOOP;
    CLOSE v_cur;
    END;
    but in this case it's not shown any result.
    So the first question is what kind of field should I use to show the result. And the second one is what can I do to being able to show all the results returned by the query (provided that is more than one single row).
    regards

    Hi Denes,
    Just starting with apex. I think I know how to show the results in a report region. I've simplified the posted question.
    A more detailed question would be: Suppose you have a region where you have put several text areas to accommodate the result of a multi-column query (lets say for TableA) that only returns one row, each column value returned put in a different text area. Also you want to show the values of other fields in TableB that depends on some value just retrieved from TableA and that you want all values retrieved (from TableA and the linked TableB) to be show in the same region. Is that possible? If yes, how?
    Thank you in advance

  • Same query giving different results

    Hi
    I m surprised to see the behaviour of oracle. I have two different sessions for same scheema on same server. In both sessions same query returns different results. The query involves some calculations like sum and divisions on number field.
    I have imported this data from another server using export / import utility available with 9i server. Before export every thing was going fine. Is there some problem with this utility.
    I m using Developer 6i as the front end for my client server application. The behaviour of my application is very surprizing as once it shows the correct data and if I close the screen and reopen, it shows wrong data.
    I m really stucked with the abnormal behaviour. Please tell me the possiblities and corrective action for these conditions.
    Regards
    Asad.

    There is nothing uncommitted in both the sessions. But still different results are returned.
    I m sending u the exact query and result returned in both sessions.
    Session 1:
    SQL> rollback;
    Rollback complete.
    SQL> SELECT CC.CREDIT_HRS,GP.GRADE_PTS
    2 FROM GRADE G, COURSE_CODE CC, GRADE_POLICY GP
    3 WHERE G.COURSE_CDE=CC.COURSE_CDE
    4 AND G.SELECTION_ID=45 AND G.GRADE_TYP=GP.GRADE_TYP
    5 AND G.TERM_PROG_ID=17 AND GP.TERM_ID=14
    6 /
    CREDIT_HRS GRADE_PTS
    3 4
    4 3.33
    4 3.33
    3 4
    3 4
    3 4
    3 4
    7 rows selected.
    SQL>
    SESSION 2:
    SQL> rollback;
    Rollback complete.
    SQL> SELECT CC.CREDIT_HRS,GP.GRADE_PTS
    2 FROM GRADE G, COURSE_CODE CC, GRADE_POLICY GP
    3 WHERE G.COURSE_CDE=CC.COURSE_CDE
    4 AND G.SELECTION_ID=45 AND G.GRADE_TYP=GP.GRADE_TYP
    5 AND G.TERM_PROG_ID=17 AND GP.TERM_ID=14
    6 /
    CREDIT_HRS GRADE_PTS
    3 4
    4 3.33
    3 4
    3 4
    3 4
    3 4
    6 rows selected.
    SQL>
    U can see in session 1, seven rows are returned while in session 2 six rows are returned. I have issued a rollback before query to be sure that data in both sessions is same.

  • SQL Server 2012 Physical vs. Hyper-V Same Query Different Results

    I have a database that is on physical hardware (16 CPU's, 32GB Ram).
    I have a copy of the database that was attached to a virtual Hyper-V server (16 CPU's, 32GB Ram).
    Both Servers and SQL Servers are identical OS=2008R2 Standard, SQL Server 2012R2 Standard same patch level SP1 CU8.
    Same query run on both servers return same data set, but the time is much different 26 Sec on Physical, 5 minutes on virtual.
    Statistics are identical on both databases, query execution plane is identical on both queries.
    Indices are identical on both databases.
    When I use set statistics IO, I get different results between the two servers.
    One table in particular (366k rows) on physical shows logical reads of 15400, on Hyper-V reports logical reads of 418,000,000 that is four hundred eighteen million for the same table.
    When the query is run on the physical it uses no CPU, when run on the Hyper-V it takes 100% of all 16 processors.
    I have experimented with Maxdop and it does exactly what it should by limiting processors but it doesn't fix the issue.

    A massive difference in logical reads usually hints at differences in the query plan.
    When you compare query plans, it is essential that you look at actual query plans.
    Please note that if your server / Hyper-V supports parallelism (which is almost always nowadays), then you are likely to have two query plans: a parallel and a serial query plan. Of course the actual query plan will make clear which one is used in which
    case.
    To say this again, this is by far the most likely reason for your problem.
    There are other (unlikely) reasons that could be the case here:
    runaway parallel threads or other bugs in the optimizer or engine. Make sure you have installed the latest service pack
    Maybe the slow server (Hyper-V) has extreme fragmentation in the relevant tables
    As mentioned by Erland, you have much much more information about the query and query plan than we do. You already know whether or not parallelism is used, how many threads are being used in it, if you have no, one or several Loop Joins in the query (my
    bet is on at least one, possibly more), etc. etc.
    With the limited information you can share (or choose to share), involving PSS is probably your best course of action.
    Gert-Jan

  • TS1702 i if use "search" in music on my ipod touch 5th gen the result just show only album and playlist but nothing song result.whats wrong with it?please help

    i if use "search" in music on my ipod touch 5th gen the result just show only album and playlist but nothing song result.whats wrong with it?please help

    The users guide says:
    Spotlight searches the following:
    Contacts—All content
    Apps—Titles
    Music—Names of songs, artists, and albums, and the titles of podcasts and videos
    Podcasts—Titles
    Videos—Titles
    Audiobooks—Titles
    Notes—Text of notes
    Calendar (Events)—Event titles, invitees, locations, and notes
    Mail—To, From, and Subject fields of all accounts (the text of messages isn’t searched)
    Reminders—Titles
    Messages—Names and text of messages
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsynce all music and resync
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iOS device.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • Different results for the same query and same data !  (oracle 9i)

    Hi,
    This is a mystery for me. I've got on my database exactly the same data that my customer (exported schema). We both launch the same query (generated by the software that we sold him). This query has a criteria IN (SELECT MAX()...) to get only data from the last year.
    The query gives 477 rows on my computer (correct answer), but no row on his! We have the same data! The only difference is the Oracle release : 9.2.0.6.0 for him, 9.2.0.1.0 for me.
    If he executes the subquery alone, it gives the expected result.
    If he replaces the MAX() in the subquery by the returned value (year 2016), he gets his 477 rows.
    I've rewritten the query with a NOT EXISTS, and now all is fine. (Less efficient but it works).
    I have no rational explication. Did I miss something ?
    Thanks for any answer.
    This is the query:
    SELECT ...
    FROM
    CRA, GRA, ...
    WHERE
    /* subselect */
    (CRA.COLLCOD, CRA.CRANEXE, CRA.CRANCODBUD, CRA.GRANNUM, CRA.CRANCOD1, CRA.CRANCOD2, CRA.CRANCOD3, CRA.CRANCOD4)
    IN (
    SELECT b.COLLCOD, MAX(cranexe), b.CRANCODBUD, b.GRANNUM, b.CRANCOD1, b.CRANCOD2, b.CRANCOD3, b.CRANCOD4
    FROM CRA b
    GROUP BY b.COLLCOD, b.CRANCODBUD, b.GRANNUM, b.CRANCOD1, b.CRANCOD2, b.CRANCOD3, b.CRANCOD4
    AND... /* other filters and joins */

    v9.2.0.1 was full of bugs. a lot of these bugs had to do with "incorrect results", typically associated with old stats or complex queries (certain types of subqueries were very likely to give wrong resutls, due to the way they were rewritten by the optimizer).
    apply the 9.2.0.6 patch set

Maybe you are looking for