Author |
Message |
denhors
Newbie
Joined: 04 Jan 2011
Online Status: Offline
Posts: 20
|
Topic: how to link one to many Posted: 28 Feb 2011 at 9:35am |
Hy! I have a problem when I connect tables (id), I get a report with one result Tb or Tc per details page, instead of an entire column on the same details page. I have three tables: Ta, Tb and Tc. Ta - contains id and user name Tb and Tc - contains various information and ID example: Ta: id name 1 John 2 Franck 3 Anna Tb: id data 1 Ford 1 Opel 1 VW 2 Ford 3 AlfaRomeo 3 VW .. How to link a table to get a list of all brands in the details for each id? GH John Da Ford Opel VW GF THX
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 28 Feb 2011 at 9:49am |
You only described two tables (I assume you are joining them on ID) but state you haev 3 tables. Can you explain more what is in the third tabl and how you are joining it to the others?
Edited by DBlank - 28 Feb 2011 at 9:49am
|
IP Logged |
|
denhors
Newbie
Joined: 04 Jan 2011
Online Status: Offline
Posts: 20
|
Posted: 01 Mar 2011 at 5:55am |
The third table is like Tb. Tables associated with the ID, but I get only one result per sheet ...
I get a print like it is in this form: GH John Yes Ford Yes Opel Yes VW GF
... 1 page John - Ford 2nd page Opel 3rd page VW
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 01 Mar 2011 at 5:58am |
so
Tb and Tc are structurally the same and each hold one record per person from Ta?
|
IP Logged |
|
denhors
Newbie
Joined: 04 Jan 2011
Online Status: Offline
Posts: 20
|
Posted: 02 Mar 2011 at 6:37am |
Ta is
a table with the
names and id's. Tb
and Tc
contain details and
descriptions of
users, more equal id
in it. More
lines Tb
and Tc
(same
id)
is associated with
one row of Ta. Example: Ta: id 1 2 3 4 5 : Tb
and Tc: id 1 1 1 2 2 3 4 4 5 5 5 :
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 02 Mar 2011 at 6:44am |
can you union Tb and Tc togther then join that to Ta on ID?
|
IP Logged |
|
denhors
Newbie
Joined: 04 Jan 2011
Online Status: Offline
Posts: 20
|
Posted: 02 Mar 2011 at 7:57am |
Yes, but this is not a problem. In detail I need to get data from Tb in 2 columns, of course depending on user ID.
|
IP Logged |
|
Keikoku
Senior Member
Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
|
Posted: 02 Mar 2011 at 8:05am |
If you join the tables together, you will join all the columns together.
So if each table had 5 columns your final result will have 15 columns.
Edited by Keikoku - 02 Mar 2011 at 8:05am
|
IP Logged |
|
denhors
Newbie
Joined: 04 Jan 2011
Online Status: Offline
Posts: 20
|
Posted: 02 Mar 2011 at 8:19am |
But I get one records per page, like I have somewhere set trigger and after each records reading from column of Tb go to the new page.
|
IP Logged |
|
Keikoku
Senior Member
Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
|
Posted: 02 Mar 2011 at 8:46am |
I was thinking SQL joins and then using a command to retrieve the values. If that is not what you're doing, I am not sure about the situation. If it is, then create a new report, use the SQL, and see your results. If you get everything as expected, then most likely it is the triggers that you're using that's causing problems.
|
IP Logged |
|
|