View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
fred fred is offline
external usenet poster
 
Posts: 73
Default How to handle second table with no values.

Try

SELECT n.NAME, p.EXT
FROM Name.n
LEFT JOIN PhoneExt p
ON p.NAME=n.NAME

Fred

"DG" wrote in message
...
Let's say I have two tables Names and PhoneExt

Names Table
Name
Bob
Larry
Sue
Tammy

PhoneExt table:
NAME EXT
Bob 3456
Larry 3458
Tammy 3463


SELECT n.NAME, p.EXT
FROM Name n, PhoneExt p
Where n.NAME = p.NAME

The result would leaves out Sue. How do I write this statement to include
"N/A" for Sue. Not sure if it is COALESCE or ISNULL. Or how to use it if
it was.

Dan