Im trying to learn how to match two files together. But I'm trying everythng for 5 hours now... And still no idea what to do.
The first file(600.000 rows) contains 4 columns:
Postal, Number, Houseletter, livingspace
The second file(7.000 rows) contains 4 columns:
Postal, Number, Houseletter, Furniturevalue
In my first file I have all the livingspaces from a big area and in my second file I have the Furniturevalue of a couple of adresses in that big area.
I want to add to the adresses in my second file the livingspaces from file 1.
So I imported the files in a database.
Table first file -> Space
Table second file -> Furniture
Now i'm trying to make Primary keys to the tables:
Primary key --> Postal, Number, Houseletter
But this doesn't work, because the columns are only unique when Postal+Number+Houseletter, but not apart from each other.
Does anyone know the next step? What do I have to do to make this query work:
SELECT postal, number, houseletter, furniturevalue, livingspace
FROM space, furniture
WHERE ( space.postal = furniture.postal
AND space.number = furniture.number
AND space.houseletter = furniture.houseletter)
Im trying to make with this query a new view with `postal, number, houseletter, furniturevalue, livingspace' So data from two tables. But first I need a solution for my problem with the primary key.
Thanks for your help!
ps: Im using sql in phpmyadmin
Primary key --> Postal, Number, Houseletter
did you try to make three primary keys or a composed primary key using the three columns ?