Let\'s say I have three tables A, B, and C. Each has two columns: a primary key and some other piece of data. They each have the same number of rows. If I JOIN
JOIN
Ok in this example you are getting duplicates because you are joining both D and S onto M. I assume you should be joining D.id onto S.id like below:
SELECT * FROM M INNER JOIN S on M.Id = S.Id INNER JOIN D ON S.Id = D.Id INNER JOIN H ON D.Id = H.Id