When I run an this stored procedure with two tables connected with inner join I expect to get two rows but the database returns four rows.
SELECT
tblEconomyPriceListCalculationPostComponents.fkEPL_ID,
tblEconomyPriceListCalculationPosts.pkEPL_CalculationPostID,
tblEconomyPriceListCalculationPostComponents.pkEPL_CalculationPostComponentID
FROM tblEconomyPriceListCalculationPostComponents
INNER JOIN tblEconomyPriceListCalculationPosts
ON tblEconomyPriceListCalculationPostComponents._fkCalculationID =
tblEconomyPriceListCalculationPosts._fkCalculationID
WHERE
(tblEconomyPriceListCalculationPostComponents._fkCalculationID = 1769)
I want this result:
<table>
<tr>
<th>fkEPL_ID</th>
<th>pkEPL_CalculationPostID</th>
<th>pkEPL_CalculationPostComponentID</th>
</tr>
<tr>
<td>137</td>
<td>2359</td>
<td>1376</td>
</tr>
<tr>
<td>137</td>
<td>2360</td>
<td>1377</td>
</tr>
</table>
I get this in return:
<table>
<tr>
<th>fkEPL_ID</th>
<th>pkEPL_CalculationPostID</th>
<th>pkEPL_CalculationPostComponentID</th>
</tr>
<tr>
<td>137</td>
<td>2359</td>
<td>1376</td>
</tr>
<tr>
<td>137</td>
<td>2360</td>
<td>1376</td>
</tr>
<tr>
<td>137</td>
<td>2359</td>
<td>1377</td>
</tr>
<tr>
<td>137</td>
<td>2360</td>
<td>1377</td>
</tr>
</table>
I’ve tried with DISTINCT in all possible ways (probably not)
7