Solved

SQL Join two tables or views problem

Posted on 2013-01-02
3
417 Views
Last Modified: 2013-01-02
I'm having a problem that I didn't envision and need someone to help me out with this to see what I am doing wrong.

I have two views (People and Address).  The People view has a Household ID record that is NOT unique as it is referenced for each person that lives in a specific household based upon a certain criteria.  Address is a list of residential addresses where the HHID is unique to each record.

I am trying to combine the two tables into a view where each persons address is also shown.

I have tried a hhid = hhid, inner join and a right join (people to address) but each one is coming up with a problem that renders it unusable.  Please let me know if you have any suggestions.

Thanks,
0
Comment
Question by:gwarcher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Accepted Solution

by:
Barry62 earned 500 total points
ID: 38737955
Is this something like you have tried (I'll assume some field names here?):

select People.Name,Address,street,Address.city,Address.ST,Address.zip inner join Address on People.hhid = Address.hhid

Select statement and we will get it figured out.
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 38737959
0
 

Author Comment

by:gwarcher
ID: 38737967
There has to be something wrong with my UID fields as everything in the select statement appears correctly.  You are right though.  I will try a couple things and get back to you if I need additional help.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

734 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