2
Hello, I’m new to SQL and I’m having a doubt. As in the example below, I wanted to take from a table 'b' the description of the code present in table 'a'. But the number of rows in table 'a' when I do this increases significantly.
select a.banana, a.caju, b.descgenero
from vegetais b
INNER JOIN desc b
on (a.cod = b.cod and a.est = b.est and a.colheita = b.colheita)
I have seen cases using INNER JOIN where table 'a' is smaller, if it does not have the corresponding code in table 'b', but I do not understand why the number of rows in table 'a' may have increased. If anyone can help me, I’d be grateful.
It would be nice for a [mcve] in a SQL Fiddle or thing of the kind to clarify better, and facilitate the visualization of the phenomenon..
– Bacco