Posted by: virusno1 November 16, 2015
SQL statement help needed
Login in to Rate this Post:     0       ?        

First of all, I am not sure why there is an emailaddress in Address table. That's just bad table design. That just violates normal form of DB design and you will end up storing tons of redundant data.
If possible redesign your table like this
Customers- contains customerid,First name last name, emailaddress
Address- Contains addressid,City State, zipcode
customeraddressBridge- customerid and addressid


Then
Select C.FirstName, C.LastName,A.City,A.State,A.Zipcode
From Customer C
join customeraddressBridge CAB
on CAB.CustomerID=C.CustomerID
join Address A
on A.AddressID=CAB.AddressID

If this is not what you are looking for then give some example what you are looking for. It's not very clear from your question.
Read Full Discussion Thread for this article