I have two database tables with some common IDs. This is the structure of the first table:
ID 1 - House 1 - New york - 0100 xxx xxx
ID 2 - House 2 - London - 0100 yyx yyx
This is the structure of the second table:
ID 101 - House 1 - Human 1 - 0100 yyy yyy
ID 102 - House 1 - Human 2 - 0100 xyx yxy
ID 103 - House 2 - Human 3 - 0100 xxy xxy
I would like to find a way to join the two tables together to result in something similar to the table below:
House 1 - New York - 0100 xxx xxx - Human 1 - 0100 yyy yyy, Human 2 - 0100 xyx yxy
UPDATE:
This is current query:
SELECT a.SO as ID, a.NOB as house, a.TEL as tel, o.IME_PREZIME as person, o.MOBILNI_TELEFON as tel2
FROM OBJEKAT a
join OBJEKAT_KONTAKTOSOBA o on o.SO=a.SO
where a.MOBILNI_TELEFON is not null and o.MOBILNI_TELEFON is not null
order by 2
And this is what i get (two or more rows for each human, and i want it under one row with multiple columns)
16 01NI 018.522.885 Marija Radosavljević 064.844.1858
17 02NI 018.243.568 Dragana Grujić 064.844.1833
17 02NI 018.243.568 Adriana Cvetković 064.844.1867
15 04SK 021.465.263 Nikolina Lulić 064.844.1860
15 04SK 021.465.263 Dragana Borovčanin 064.844.1852
12 05KA 024.877.077 Milena Lončar 064.844.1724
As you can see, under ID 17 and 15 I have two rows and I want It to be one like I show you in first explanation.
THIRD EDIT: What i want is this:
17 02NI 018.243.568 Dragana Grujić 064.844.1833 Adriana Cvetković 064.844.1867
FOURTH EDIT: This is not duplicate, above duplicate suggestions is for mysql, and i have Firebird, whis doesn't have GROUP_CONCAT function