>>This is 1-M Relationship.
>>
>>Table2 - Parent Table. Field1 is PK field. One record for each Field1 PK
>>Table1 - Foreign table. Field1 is a Foreign key. It could have several records for the same value of Field1.
>>
>
>:) Usually I would think in reverse that's why it was a bit confusing.
>
>Now, back to the original question - which rows of Table1 do you want to get per single Field1 (PK) in the table2 ?
Here is an example:
FIELD1 FIELDX FIELDY
2
4
2
2
1
4
4
FIELD1 FIELD2 FIELD3
1 'ABC' '123'
2 'XYZ' '456'
3 'DFD' '333'
4 'DDF' '444'
FIELD1 FIELD2 FIELD3
1 'ABC' '123'
2 'XYZ' '456'
4 'DDF' '444'
Now that I wrote the example, above, I think I can SELECT from Table2 and JOIN Table1 on FIELD1.
But the question is, if I follow my initial example and SELECT FROM Table1 and JOINT Table2, is it better to use
DISTINCT() or GROUP BY (with MAX())?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham