Select count(*) gives different value

Hi Experts,
I have a table with more tnan 50 thousand records with 8 indexes.
When i am trying below query
select * from customer_table
          WHERE line_id IS NULL
          AND balance >= 0
          AND dept_code = '233'
          AND overline IS NOT NULL
          AND rstat= 'O'
          AND astat ='A';
i am getting 61 rows however when i am trying
     select count(*) from customer_table
          WHERE line_id IS NULL
          AND balance >= 0
          AND dept_code = '233'
          AND overline IS NOT NULL
          AND rstat= 'O'
          AND astat ='A';
i am getting 43. it is strange to get different results..
I did index rebuild and even recreation of indexes also..still same result..
does any body have any clue abut this...
plz help..

Please post your (4 digit) Oracle version.
You can try the same select in SQL*PLus just to rule out any issues with SQL Navigator.
I guess you did run those two statements several times and the result of consistent? If not then some other user/automatic job could be changing data and commitiing between your two selects.
Furthermore you can use the NO_INDEX hint on both selects, just to rule out any index problems.
Since you have only 61 rows max. you can add a few more restrictions and by that find out which rows are not counted.
Edited by: Sven W. on Aug 26, 2009 2:43 PM

Similar Messages

  • Different measures use same source column but gives different values in SSAS project

    I've inherited a SSAS project. I'm currentlig gaining knowledge, but do not understand this: There are 4 measures that get data from same source table and column. Example measures:
    [Started]
    [Processing]
    [Processed]
    [Finished]
    All of them gets data from a table (view), and a column "Event_count" with just value 0 in each row. Usage of the measure is "Count of non-empty values".
    Correctly all of these measures gives different values, but I don't understand how since they all go against the same source column. I thougt maybe they were defined in Calculated measures, but nothing there. Where or what else could be affecting this behavior?
    Bonus information (problem): One of the measures is returning blank/empty, which is why started with this research at all.
    Help anyone?
    regards .r

    Hi ,
    I would ask if all the measures are under the same measure group ? It is important to know, since in the dimension usage we are creating relationships between dimensions and measure
    groups .
    Did you try the delete all the calculation's code and leave only the " CALCULATE ; " part ? Do the values change after deploying the slim script ?
    Are all properties the same ? defaults & caching ?
    Regards, David .

  • SELECT COUNT( ) gives warning in ECC6.0.

    Hi,
    The following query is giving syntax error in ECC6.0, where as it worked absolutely fine in 3.1i server.
    SELECT COUNT( OBOX_CNTNO ) FROM  ZT2OB
                                 INTO  W_COUNT
                                 WHERE SUPPL_CD   = W_SUPPL_CD
                                 AND   INVC_NO    = W_INVC_NO
                                 AND   INVC_LN_NO = T_SCR_ITEMS-INVC_LN_NO.
    Error: "COUNT( OBOX_CNTNO )" is only valid in the extended form "COUNT( DIS
    OBOX_CNTNO )" . . .
    The query seems obsolete in ECC6.0. Can anybody help me to give valid query for this in ECC6.0?

    Hi,
    <b>Count</b> functionality is to be used along with <b>Distinct</b> functionality.
    COUNT( DISTINCT col )
    <b>Reward points if this helps,</b>
    Kiran

  • How to give different value to a static variable???

    Hi all:
    Is there any solution to set different values to a static variable???I had try two ways but all have errors!
    1.Way_1
    protected String tmp=null;
    protected void initSituation(int sayorpress)
    if (sayorpress==0)
    tmp = "string1";
    else if (sayorpress==1)
    tmp = "string2";
    protected static String RESOURCE_STRING = tmp; <---error
    Error:non-static variable tmp cannot be referenced from a static context
    2.Way_2
    protected void initSituation(int sayorpress)
    if (sayorpress==0)
    protected static String RESOURCE_STRING = "string1"; <---error
    else if (sayorpress==1)
    protected static String RESOURCE_STRING = "string2"; <---error
    Error:illegal start of expression at
    not an expression statement at
    Thank you very mich!!!

    Try this:
    protected static String RESOURCE_STRING = null;
    protected void initSituation(int sayorpress)
    if (sayorpress==0)
    yourClass.RESOURCE_STRING = "string1";
    else if (sayorpress==1)
    yourClass.RESOURCE_STRING = "string2";
    You cannot declare a static variable inside a method. But you can access a static variable thorugh your class.

  • MAX custom scales give different values in LabVIEW

    I'm having a MAX issue I think.  I have several tasks configured to run on a CDAQ chassis.  Each channel in each task has custom scales defined in MAX.  When I run each task in MAX, I get properly scaled values.  When I run the same tasks inside a VI, I get junk.  As in, the values either aren't scaled or are scaled to something arbitrary.  Anyone seen this before?  Anything I should check into?
    Thanks.
    CLAD

    Hey,
    Do you see this behavior if you use a pre-built shipping example, or just in your custom application?
    Matt W.
    Applications Engineer
    National Instruments

  • ParseInt gives different values for negative numbers than other browsers

    Is this an known issue?
    I tested in Safari 4 beta (528.16), don't know about other releases.
    parseInt(-0.5) in Safari returns -1, while Chrome 3, Opera 10 and Firefox 3.5 returns zero.
    How can I workaround this?

    Hi,
    I tested in Safari 4 beta (528.16), don't know about other releases.
    Test with the official release. If you think it's a bug, you can report it at http://bugs.webkit.org

  • Why do About This Mac and Finder give different values of available space on my MacBook Pro?

    About This Mac is reporting over 150 GB of disk space usage for backups on my MacBook Pro (2 GHz Intel Core i7, mid 2011) (About This Mac|More Info|Storage).  Disk Utility shows the same usage as About This Mac.
    When I check the available disk space in Finder, it reports approx 150GB more available (i.e. does not seem to see the backups).
    I have never used the MacBook for backup - I back up to a Time Capsule.
    I bought the MacBook second-hand - I have deleted the old users from Users & Groups. Is it possible that there is a hidden backup lurking on the disk? If so, how can I access it and delete it?
    Is it possible that there is a bug in the Mountain Lion About This Mac storage reporting (but if so, why does the usage reported by Disk Utility agree with Abouth This Mac, but not with Finder?)
    I really don't want to have to format my disk and restore from Time Machine. I'm not sure that the Time Machine backup does not include the 150GB of "hidden" files...
    Any help would be appreciated.
    Craig

    It is local snapshots that Time Machine makes. Even when not connected to TM disk, TM creates local snapshots on your HD. Finder does not consider local snapshots essential and will use the space if necessary.

  • Creating a Material with different values for fields in Transaction MM01

    Hello All,
    While creating a material i will be giving a Profit Center in Sales:general/plant view, which i can see in Costing1 View. If i change this in this View it automatically changes in the other View. Is there any way to give different values in the two views or then what is the significance in showing the same field again in two different views.
    Thanks,
    Shashidhar.

    Hi,
    Its just a way of showing the data in different views for user. It doesn't have any significance.
    Regards,
    Sudheer.

  • P/L A/c for a single day gives different results for different users

    Hi!
         We have SAP B1 8.81 (PL 09) in our office. P/L Account for a particular date gives different value for a single account (Other Income Account) for one user and a consistent value for all other users. The user in question is a super user and does not seem to pick a specific entry posted in the Other Income Account for that day thus giving erroneous result. I have checked the Trial Balance for that day and it gives proper result. Only the P/L account gives erroneous data. Could anyone help with the reason for this.
    Thanks
    Sreekumar

    Hi Jitin,
              Thanks for your reply.
              I tried the way you mentioned. However, the result is the same.
              The entry that I'm talking about is an automatic journal entry posted through the Outgoing Payment option.
              To make it more clear, an outgoing payment to a vendor was posted on 05/19/11 for 1,42,178.32. The check was drawn only for 71,089.16 which was the correct amount and the remaining amount (71,089.16) got posted in the Other Income account. The P/L account for this date is not picking the amount of 71,089.16 in the Other Income Account.
    Thanks & Regards
    Sreekumar
    Edited by: Sreekumar on Jan 31, 2012 5:58 PM

  • SAPSCRIPT Quantity Symbol printing different values

    Hi,
    I am generating a Printout & Fax at a time for the Purchase Order output, a SYMBOL which is having a conversion value is printing different values in FAX output. Both the Printout and Fax uses the same Print Program but different sapscripts which have same formatting for printing the conversion value (different scripts but copied one and no changes in the script).
    the following symbol is printing different values:
    Print program:
    data: p_value type ekpo-menge,
             umbsz TYPE umbsz.
    umbsz = marm-umrez / marm-umren.
    p_value = umbsz.
    Script
    &p_value(7.0R)&
    This &p_value(7.0R)& gives different values in Printout and Fax and this difference is not for every document, it is for some documents and there are no changes in conversions also.
    My question is: "Is there any problem in using (7.0R) for datatype menge, I mean restrict the no.of characters and decimals at a time for quantity field type".
    Thanks in Advance.
    Ravi

    Hi Ravi,
    Try doing a WRITE - TO in your program. Make the variable p_value type char.
    Another suggestion would be to get the value doing a PERFORM xxxxx IN PROGRAM and retrieve the value from there.
    Regards,
    Ernesto.

  • How to run a select count(*) with multiple rows returned

    Hi,
    I have to run a select count(*) for different reports.
    1) Select count(*) from table
    where state = 'CA'
    2) Select count(*) from table
    where state = 'NY'
    3) Select count(*) from table
    where state = 'NV'
    Instead of running this query again for 50 times, is there a way for me to just put it in one query and get multiple row returns? Thank you.

    Samantha wrote:
    Hi,
    I have to run a select count(*) for different reports.
    1) Select count(*) from table
    where state = 'CA'
    2) Select count(*) from table
    where state = 'NY'
    3) Select count(*) from table
    where state = 'NV'
    Instead of running this query again for 50 times, is there a way for me to just put it in one query and get multiple row returns? Thank you.select state, count(*) from table group by state order by 1;

  • Count of rows having different values

    SQL>  select  * from med;
    CERT  REC  PRIM RACE
    100    10   EN   USA
    100    11   EN   USA
    100    12   EN   USA
    100    13   SP   MX
    200    14   SP   MX
    200    15   SP   MX
    6 rows selected.
    SQL>  select  * from sub;
    CERT  REC PRIM RACE
    100    10   EN   USA
    100    11   EN   USA
    100    12   EN   USA
    100    13   SP   MX
    200    14   SP   MX
    200    15
    6 rows selected.
    SQL> select  * from den;
    CERT  REC  PRIM RACE
    100    01   EN   USA
    100    02   EN   USA
    100    03   EN   USA
    100    04   SP   MX
    200    06   SP   MX
    (cert,rec) uniquly identifies a person;
    In Den table rec =med.rec-9 or rec =sub.rec-9 which implies
                med       sub     den
    (cert,rec)=(100,10)=(100,10)=(100,01)How can I find out how many people in the table where the PRIM and RACE hold different values.?

    Hi,
    Perhaps this ,
    with med as (
    select 100 CERT,   10 rec,   'EN' prim,   'USA' race from dual union all
    select 100  ,  11,   'EN',   'USA' from dual union all
    select 100  ,  12,   'EN',   'USA' from dual union all
    select 100  ,  13,   'SP',   'MX' from dual union all
    select 200  ,  14,   'SP',   'MX' from dual union all
    select 200  ,  15,   'SP',   'MX' from dual )
    sub as (
    select 100 CERT,    10 rec ,  'EN' prim,   'USA' race from dual union all
    select 100,    11 ,  'EN',   'USA' from dual union all
    select 100,    12 ,  'EN',   'USA' from dual union all
    select 100,    13 ,  'SP',   'MX' from dual union all
    select 200,    14 ,  'SP',   'MX' from dual union all
    select 200,    15, null, null  from dual )
    den as (
    select 100 cert,    01 rec,   'EN' prim,  'USA' race from dual union all
    select 100,    02,   'EN' ,  'USA'from dual union all
    select 100,    03,   'EN' ,  'USA'from dual union all
    select 100,    04,   'SP' ,  'MX'from dual union all
    select 200,    06,   'SP' ,  'MX'from dual )
    ----- sample data
    select cert, prim, race ,count(rec) rec
    from (
    select *
    from med
    union all
    select *
    from sub
    union all
    select *
    from den
    group by cert, prim, race
    ORDER BY 1,2,3
          CERT PR RAC        REC
           100 EN USA          9
           100 SP MX           3
           200 SP MX           4
           200                 1HTH
    SS

  • "select count(*)" and "select single *" returns different result

    Good day!
    product version SAP ECC 6.0
    oracle10
    data transfers from external oracle db into customer tables using direct oracle db link
    sometimes I get case with different results from 2 statements
    *mytable has 10 rows
    *1st statement
    data: cnt type I value 0.
    select count( * ) into cnt from mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *cnt returns 10 - correct
    *2nd statement
    select single * from  mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *sy-dbcnt returns 0
    *sy-subrc returns 4 - incorrect, 10 rows are "invisible"
    but
    1. se16 shows correct row number
    2. I update just one row from "invisible" rows using se16 and 2nd statement returns correct result after that
    can not understand why
    thank you in advance.

    Thank you, Vishal
    but,
    general problem is that
    1. both statements have the same WHERE conditions
    2. 1st return resultset with data (sy-dbcnt=10), 2nd return empty dataset, but must return 1 in sy-dbcnt
    Yes, different meaning, you are right, but must 2nd must return 1, because of "select single *" construction, not 0.
    Dataset to process is the same, WHERE conditions are equal...
    I think the problem is that how ABAP interperets select count(*) and "select single *".
    Maybe "select count (*)" scans only PK from index page(s)? and "select single *" scans data pages? and something is wrong with that?
    I'm new in SAP and didn't find any SAP tool to trace dump of data and indexes pages with Native SQL.
    se16 shows all records.
    And why after simple manual update of just one record using se16 "select single *" returns 1?
    I've just marked one row to update, didn't change any data, then pressed "save".

  • DIfferent # of rows return using select * & select count(*)

    In debugging some code (OWB generated PL/SQL) I came across the situation where by a query with count(*) returns a value of 600 rows. The same where clause using select * reports only 300 rows selected. There are 600 rows to select.
    Any ideas why the difference ???
    The code:
    SELECT *
    FROM "STG_SYSTEM_CUSTOMER_V" "STG_SYSTEM_CUSTOMER_V",
    DW_REPRESENTATIVE INGRP8
    where "STG_SYSTEM_CUSTOMER_V"."PILLAR_STATE_CD" IN 'VIC'
    AND "STG_SYSTEM_CUSTOMER_V"."BUS_PILLAR_CD" = 'IGA'
    AND ( "STG_SYSTEM_CUSTOMER_V"."MN_COMP_CD" = "INGRP8"."MN_COMP_CD" (+) )
    AND ( "STG_SYSTEM_CUSTOMER_V"."COUNTRY_CD" = "INGRP8"."COUNTRY_CD" (+) )
    AND ( "STG_SYSTEM_CUSTOMER_V"."COMP_CD" = "INGRP8"."COMP_CD" (+) )
    AND ( "STG_SYSTEM_CUSTOMER_V"."BUS_PILLAR_CD" = "INGRP8"."BUS_PILLAR_CD" (+) )
    AND ( "STG_SYSTEM_CUSTOMER_V"."PILLAR_STATE_CD" = "INGRP8"."PILLAR_STATE_CD" (+) )
    AND ( "STG_SYSTEM_CUSTOMER_V"."SUPP_DIVISION_CD" = "INGRP8"."DIVISION_CD" (+) )
    AND ( "STG_SYSTEM_CUSTOMER_V"."ALM_REP_NUM" = "INGRP8"."REP_NUM" (+) )
    Cheers
    Pav

    You're sure that the only difference between the two statelents is that "*" is replaced with "count(*)"? Assuming there are no transactions going on simultaneously, that would be a bug. Have you installed the latest patchset to your database?
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • Why does my Macintosh HD and Utility Disk give different available space values?

    My MacBook Pro (about a year and a half old) has started running extremely slowly out of the blue, to the point it is barely functional. I've tried basically everything, restarting, cleaning up the desktop, clearing out my downloads file, starting in safe mode, resetting the PRAM, updating the operating system. Now my Mac HD says it has about 400GB free space out of 700GB, however today I was running utility disk to see if that would detect a problem and when selecting the first Macintosh HD option it says I only have around 18MB free, is this my problem? and if so how do I fix it? and why would I have two different values for available space? The second Macintosh HD entry does have the same available space in the get info page as is listed in the Disk Utility.

    “Finder does not take into account the  Backups/ local snapshots,
    but disk utility includes them.”
    http://pondini.org/TM/30.html
    Disk space / Time Machine ?/ Local Snapshots
    Local backups
    http://support.apple.com/kb/PH18861?viewlocale=en_US&locale=en_US

Maybe you are looking for

  • FaceTime won't output audio to TV using AV adapter with iphone 4s

    I'm using an iPhone 4S with ios 6-something.  When I hook it to my tv with the Apple AV HDMI adapter the video goes but no sound.  The phone sends sound from other apps (Music, YouTube), so I'm thinking it's specific to FaceTime.  Any suggestions?

  • Photo recovery after Leopard install

    After performing an archive and reinstall to install Leopard, I can't find my photos. The "previous system" folder created in the process contains a "My iPhoto library" (has 1000 MB)file in the "pictures" folder in users.. Do the photos reside here?

  • Is it possible to do query without pre-defined EO/VO

    I want to implement the following login logic using .jsp: (1) user type in user_name and password, then click 'Login' button (2) do query on table USER: if user_name/password passed in is a valid record, login success; if not, user will be asked to l

  • Anybody using cTable UI element in real life projects?

    Hi guys, just curious, since there is very few content about the client side table (available since NW 7.30) Web Dynpro ABAP UI element here on SDN ( sap help link ) Is anybody using this UI element in a more ore less complex application? Since I'd l

  • Content Repositories in Navigation Model not visible

    Hi, I use JDev 11.1.1.7 and WCC/WCP 11.1.1.7. I did follow the tutorial in the Oracle WCP documentation and created a connection to the Content Repository. http://docs.oracle.com/cd/E28280_01/webcenter.1111/e10273/createconnect.htm#BGBDDHAA Step 1 is