It can be pretty simple. I just don't see a tree for trees at the moment. In Oracle, I select records from table A that join table B based on the primary key of table A. However, table B may have several records matching the primary key of table A. This prompts my query to return duplicate rows from table A. Below is an abbreviated version of my request:
TableA TableB _______ _________ 1, Sec1 2, 11/01/2011 2, Sec2 2 3, Sec3 5, 10/01/2011 4, Sec4 6, 10/01/2011 Select A.SecID, A.SecName, B.DateSent from tableA A inner join tableB B on A.SecID = B.SecID
This returns 2 records for Sec2 - how can I make it return only 1 record for Sec2? I tried using different and unique ones, but still get the same results.
sql oracle plsql
Ciaran bruen
source share