Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> help with join

help with join

From: Johnathan <johnpalm_at_1hostplus.com>
Date: 18 Nov 2003 11:50:19 -0800
Message-ID: <ea5ec343.0311181150.f275641@posting.google.com>


Ok,

 your going to think that I am nuts, but I am trying to join table_a to table_b but table_b has more then one row for table_a. I would like to get all the data on one row back. I would like to join table_a with table_b based on p_id so for instance I would like one row with name, phone number, data. For example the end rows would look like the following: in table b phone number is the row with fieldid = "03" and the date is fieldid ="04"

+---------+--------------+-----------------+

| name | phone | date |
+---------+--------------+-----------------+
| john | 201-123-1111 | 09/24/2004 |
| sabrina | 201-133-2222 | 11/23/2003 |
+---------+--------------+-----------------+

TABLE A:
+------+---------+
| p_id | name |

+------+---------+
| 1 | john |
| 2 | sabrina |

+------+---------+
TABLE B: +------+--------------+---------+
| p_id | value | fieldid |

+------+--------------+---------+
| 1 | 201-123-1111 | 03 |
| 1 | 09/24/2004 | 04 |
| 2 | 201-133-2222 | 04 |
| 2 | 11/23/2003 | 03 |

+------+--------------+---------+

PLEASE EMAIL ME BACK AT johnpalm_at_1hostplus.com with any help that you may have

thanks Received on Tue Nov 18 2003 - 13:50:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US