I have two tables I want to join, but I only want the top row of the second table, ie:
table1:
col1 col2
aaaa bbbb
cccc dddd
table2:
col3 col4
aaaa eeee
aaaa ffff
Desired result:
col1 col2 col4
aaaa bbbb eeee
cccc dddd null
At the moment I have
SELECT * FROM table1 t1
LEFT JOIN table2 t2
ON t1.col1 = t2.col3
But I get:
col1 col2 col4
aaaa bbbb eeee
aaaa bbbb ffff
cccc dddd null
How can I adjust the query?
Jon
"I don't regret this, but I both rue and lament it.
table1:
col1 col2
aaaa bbbb
cccc dddd
table2:
col3 col4
aaaa eeee
aaaa ffff
Desired result:
col1 col2 col4
aaaa bbbb eeee
cccc dddd null
At the moment I have
SELECT * FROM table1 t1
LEFT JOIN table2 t2
ON t1.col1 = t2.col3
But I get:
col1 col2 col4
aaaa bbbb eeee
aaaa bbbb ffff
cccc dddd null
How can I adjust the query?
Jon
"I don't regret this, but I both rue and lament it.