• 0

SQL Query Help (MYSQL)


Question

Little rusty on MYSQL and need help with a query I have been tasked with writing.  

 

 

I have 5 tables 

 

CommonParcel Table

  • CommonParcel_ID
  • Parcel

 

Address Table

  • Address1
  • Address2
  • City
  • State 
  • ZIP
  • Address_ID
  • Location_ID2

 

Common Parcel Address Table  (Join Table for above two tables)

  • Address_ID
  • CommonParcel_ID 

 

Owner Table

  • ?Owner_ID
  • ?Owner Name 

CommonParcelOwnerLink  (Join table for Owner Table & Common Parcel Table)

  • CommonParcel_ID
  • Owner_ID

 

 

 

I created a query but seem to be missing something as it isn't working properly and any help would be appreciated.  

 

Thanks guys! 

Select location_id2, address1, address2, city, state, zip 
      From Address 
Inner Join CommonParcelAddress on Address_ID = address_id 
Inner Join CommonParcel on CommonParcel_ID = CommonParcel_ID 
Inner Join CommonParcelCommonPartyLink on CommonParcel_ID = CommonParcel_ID 
Inner Join Owner on Owner_ID = Owner_ID
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I got it all figured out and thought i would post it in case it helped someone.

 

I had to declare the tables in my inner join statements as the clause was ambiguous 

Inner Join CommonParcelAddress on CommonParcelAddress.Address_ID = Address.address_id 
Link to comment
Share on other sites

This topic is now closed to further replies.