Home » SQL & PL/SQL » SQL & PL/SQL » outer join problem (10g, xp)
outer join problem [message #327915] Wed, 18 June 2008 06:32 Go to next message
rzkhan
Messages: 345
Registered: March 2005
Senior Member
I get the same no of rows even after outer join.
Can any guy help me ?

Thanks

SQL> ed
Wrote file afiedt.buf

  1  select count(*)
  2  from
  3  (
  4   select cardno,testcentre
  5   from bsd
  6   order by 2 desc
  7* )
  8  /

  COUNT(*)
----------
      4612

SQL> ed
Wrote file afiedt.buf

  1  select count(*)
  2  from
  3  (
  4   select cardno,centre
  5   from bsd,centres
  6  where bsd.testcentre=centres.centre_id
  7   order by 2 desc
  8* )
SQL> /

  COUNT(*)
----------
      4554

SQL> ed
Wrote file afiedt.buf

  1  select count(*)
  2  from
  3  (
  4   select cardno,centre
  5   from bsd,centres
  6  where bsd.testcentre(+)=centres.centre_id
  7   order by 2 desc
  8* )
SQL> /

  COUNT(*)
----------
      4554

SQL> 
Re: outer join problem [message #327920 is a reply to message #327915] Wed, 18 June 2008 06:37 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
What outer join actually does??

If you can answer to this question i think you can get answer to your question.

Regards,
Rajat Ratewal
Re: outer join problem [message #327922 is a reply to message #327915] Wed, 18 June 2008 06:44 Go to previous messageGo to next message
Michel Cadot
Messages: 64126
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL Reference, Joins

Regards
Michel
Re: outer join problem [message #327993 is a reply to message #327915] Wed, 18 June 2008 09:49 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You've got your outer join the wrong way round. Should be
where bsd.testcentre=centres.centre_id(+)
Previous Topic: More Efficient Top N
Next Topic: SQL - select/delete data date older than today(3 days)
Goto Forum:
  


Current Time: Wed Dec 07 06:43:49 CST 2016

Total time taken to generate the page: 0.05347 seconds