Home » SQL & PL/SQL » SQL & PL/SQL » HELP NEEDED!COUNT()??-----URGENT!!!!
HELP NEEDED!COUNT()??-----URGENT!!!! [message #4000] Thu, 31 October 2002 22:47 Go to next message
TECH
Messages: 3
Registered: October 2002
Junior Member
HELLO EVERYONE

I HAVE A TABLE - PROPERTY:

SUBURB
----------
bondi
bronte
clovelly
coogee
hillsdale
kingsford
maroubra
randwick
waverley

I ALSO HAVE ANOTHER TABLE - P1

SUBURB NUMBER#
-------------------- ----------
clovelly 2
coogee 3
randwick 1

NOW I WANT TO DISPLAY SUCH THAT FOR EACH SUBURB IN PROPERTY, IT WILL SHOW THE NUMBER IN P1 IF THE SUBURB CORRESPONDS OTHERWISE DISPLAY ZERO.

SUBURB NUMBER#
-------------------- ----------
bondi 0
bronte 0
clovelly 2
coogee 3
hillsdale 0
kingsford 0
maroubra 0
randwick 1
waverley 0

PLEASE HELP OUT!
CHEERS
TECH
Re: HELP NEEDED!COUNT()??-----URGENT!!!! [message #4002 is a reply to message #4000] Thu, 31 October 2002 23:19 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
http://www.orafaq.net/msgboard/sql/messages/17013.htm
Re: HELP NEEDED!COUNT()??-----URGENT!!!! [message #4005 is a reply to message #4000] Fri, 01 November 2002 06:14 Go to previous message
Krish Jayarangan
Messages: 10
Registered: August 2002
Junior Member
Use the following:
select Property.SUBURB, NVL(P1.number#, 0)
from Property, P1
where Property.SUBURB = P1.SUBURB(+);

-Thanks.
-Krish.
Previous Topic: regarding Name-in and copy built-ins
Next Topic: Line Break
Goto Forum:
  


Current Time: Sun Apr 28 19:53:03 CDT 2024