Solved

SQL Query to pull two fields from two different tables

Posted on 2014-02-06
1
220 Views
Last Modified: 2014-02-06
I'm trying to do the following using a select to find all addrnames that do not have a zipcode. Addrname and zipcode live in two different tables.

----pseudo code

SELECT DISTINCT Addrname
from tableA

where tableB.zipcode is NULL
0
Comment
Question by:bjbrown
1 Comment
 
LVL 16

Accepted Solution

by:
Brian Pringle earned 500 total points
ID: 39839568
You would need to select data from tableA, tableB and form some sort of relationship.  Can you provide information about the column names in each table?  What is the name of the column in each table that forms the relationship?

It would be something like...

select tableA.Addrname
from tableA, tableB
where tableA.somecolumn = tableB.somecolumn
and tableB.zipcode is NULL
                     (or maybe just tableB.zipcode = "")
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SPAM and Ransomware and Backup 11 90
Runtime Error 2 28
Turn on intranet settings 1 41
Samsung Smart View subtitles don't work 1 76
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now