![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi I am just doing my first steps in SQL (SQLite3) and have to following problem. I have the following two tables: Table_A ID_A * *name ------------- 1 * * * Name1 2 * * * Name2 3 * * * Name3 Table_B ID_B * *key * * value ----------------------------- 1 * * * 3 * * * Jamaica 2 * * * 1 * * * Canal Street 2 * * * 2 * * * New York 2 * * * 3 * * * USA 3 * * * 1 * * * Endell Street 3 * * * 3 * * * England Hence, Table_B contains the street, city and country (key 1,2 and 3) of the persons in Table_A. Now I want to join these two tables into a single one of the following form: name * * * * * *street * * * * *city * * * * * *country ------------------------------------------------------- Name1 * * * * * * * * * * * * * * * * ** * * * Jamaica Name2 * * * * * Canal Street * *New York * * * *USA Name3 * * * * * Endell Street * * * * * * * * * England Using LEFT OUTER JOIN I was able to output the names and e.g. the streets: SELECT Table_A.name,Table_B.value FROM Table_A LEFT OUTER JOIN Table_B ON Table_A.ID_A=Table_B.ID_B AND Table_B.key=1 But how could I simultaneously output the cities and countries in addition? Many thanks and best regards, Daniel |
#3
| |||
| |||
|
|
I am just doing my first steps in SQL (SQLite3) |
#4
| |||
| |||
|
|
I am just doing my first steps in SQL (SQLite3) and have to following problem. I have the following two tables: |
![]() |
| Thread Tools | |
| Display Modes | |
| |