Home » SQL & PL/SQL » SQL & PL/SQL » Bizarre Counts
Bizarre Counts [message #20887] Thu, 27 June 2002 08:57 Go to next message
cath
Messages: 4
Registered: March 2002
Junior Member
Hi

I run a query and at the end it says "2100 rows selected". If I replace the selected fields with a count(*) instead, the same query says 2114 rows counted. I cannot understand why the count wouldn't be the same. Anyone ever encounter this? Thanks in advance for your help.

Catherine

Here is my query 1:
SELECT p.product_id,t.title_id
FROM product p , title t
WHERE p.source_id in (1000,1001,1002)
AND p.product_id not in(SELECT pa.product_id
FROM product_attributes pa)
AND p.title_id = t.title_id
AND t.c_text like '%Basic Product Data%'
AND t.deleted = 'N';

Here is query 2:
SELECT count(*)
FROM product p , title t
WHERE p.source_id in (1000,1001,1002)
AND p.product_id not in(SELECT pa.product_id
FROM product_attributes pa)
AND p.title_id = t.title_id
AND t.c_text like '%Basic Product Data%'
AND t.deleted = 'N';
Re: Bizarre Counts [message #20892 is a reply to message #20887] Thu, 27 June 2002 22:34 Go to previous message
Niranjan
Messages: 34
Registered: June 2001
Member
Check that there is record for each title in product
or try by giving outer join like

AND p.title_id = t.title_id(+)
Previous Topic: Re: ora-00600[17034].
Next Topic: SQL Query
Goto Forum:
  


Current Time: Thu Apr 25 02:08:54 CDT 2024