Home » SQL & PL/SQL » SQL & PL/SQL » URGENT: Query help needed
URGENT: Query help needed [message #22530] Wed, 16 October 2002 08:19 Go to next message
Raj
Messages: 411
Registered: November 1998
Senior Member
query A:
--------
select a.sequence_nmbr, count(sequence_nmbr)
from TABLE A
group by a.sequence_nmbr
order by a.sequence_nmbr;

QUERY B:
-------
select count(temp_sequence_nmbr)
from Table B
WHERE a.sequence_nmbr = b.temp_sequence_nmbr and
a.sequence_nmbr = b.temp_sequence_nmbr;

My objective is to get the list of sequEnce_nmbrs
from TABLE A where the count(sequence_nmbrs) from table A is not equal to count(temp_sequence_nmbr) from
table B. for the same records in TABLE A and TABLE B.

Could someone modify the query and post it please!!!!!

Thanks
Raj
Re: URGENT: Query help needed [message #22532 is a reply to message #22530] Wed, 16 October 2002 09:03 Go to previous messageGo to next message
Amit Chauhan
Messages: 74
Registered: July 1999
Member
select a.sequence_nmbr, count(sequence_nmbr)
from TABLE_A a
group by a.sequence_nmbr
having count (sequence_nmbr) = (select count(temp_sequence_nmbr)) from TABLE_B b
where a.sequence_nmbr = b.temp_sequence_nmbr
)
order by a.sequence_nmbr;


Hope that helps
Thanks
Amit
Re: URGENT: Query help needed [message #22538 is a reply to message #22530] Wed, 16 October 2002 12:05 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Just a small correction (not equal):

select a.sequence_nmbr
  from a
 group by a.sequence_nmbr
 having count(*) <> (select count(*)
                       from b 
                      where a.sequence_nmbr = b.temp_sequence_nmbr);
Previous Topic: how to become oracle application DBA
Next Topic: ORA-06502 in Cursor Data Type Long
Goto Forum:
  


Current Time: Fri May 03 07:48:51 CDT 2024