tbl_A has column "ID" with duplicates. tbl_B has column "ID" with distinct values.
i want to find all the distinct IDs in tbl_A that are present in tbl_B.
I've tried the following with no luck:
SELECT DISTINCT tbl_A.ID
FROM tbl_A LEFT JOIN tbl_B ON tbl_A.ID = tbl_B.ID
WHERE tbl_A.ID IN tbl_B.ID;
I know i'm doing something wrong but i can't figure it out.
PLEASE HELP!
Thanks!
-ed
i want to find all the distinct IDs in tbl_A that are present in tbl_B.
I've tried the following with no luck:
SELECT DISTINCT tbl_A.ID
FROM tbl_A LEFT JOIN tbl_B ON tbl_A.ID = tbl_B.ID
WHERE tbl_A.ID IN tbl_B.ID;
I know i'm doing something wrong but i can't figure it out.
PLEASE HELP!
Thanks!
-ed