469,126 Members | 1,255 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,126 developers. It's quick & easy.

Help Linking Tables in SQL

Follow-up question:
{This new question has been split away from the original thread (Find the lowest value in an array of results within a SELECT statement... possible?) as threads may only contain a single question - NeoPa.}
I've realized I should probably be using a LEFT JOIN instead of an INNER JOIN, because I'm getting incorrect records, but how can I use a LEFT JOIN in this case? Is there a way to convert the
Expand|Select|Wrap|Line Numbers
  1. ON (t1.EMP_ID = t2.EMP_ID) AND (t1.DamLev = t2.MinDamLev);
to two field values like these?
Expand|Select|Wrap|Line Numbers
  1. ON table1.column = table2.column;
Jan 18 '16 #1
4 747
12,516 Expert Mod 8TB
I'm not sure what you mean exactly but just change the word inner to left. But it would help if you explain what you mean by "incorrect records"
Jan 18 '16 #2
32,161 Expert Mod 16PB
As Rabbit says - It's going to be hard to follow and help if you don't give some more details as to what's wrong with the results.

My guess, with very little to go on, is that the problem is not related to the type of JOIN used.
Jan 18 '16 #3
Sorry guys - I swear I tested it on Friday and it wasn't working but Rabbit you're absolutely right - just changing the word "inner" to "left" changed the join. NeoPa you're also right; it didn't fix the problem LOL

I need to think through the logic a bit more before I post. Please disregard this and I'll come back later when I'm making more sense :/
Jan 18 '16 #4
32,161 Expert Mod 16PB
No worries Jen. If you get it together you can come back in here and post the details.
Jan 18 '16 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Christoph Sticksel | last post: by
2 posts views Thread by Matthew Wells | last post: by
1 post views Thread by deiopajw | last post: by
4 posts views Thread by trevordixon | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.