![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have 3 tables: Import_accomodation: - several attributes..... - continentname - regionname Continent: - ContinentId (PK) - ContinentName Country: - CountryId (PK) - ContinentId (FK, can be null) - CountryName The import_accomodation table is a flat table from which I want to transfer data into the continent and country tables. Of course these are related. I don't know which query to use for this. To fill continent I use: insert into continent select continentname from import_accomodation where continentname != '' and continentname not in (select name from continent) But to fill country I don't know how to create a query to get the optional relation. Thanks a lot. |
#3
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |