Left Join table not work

Hi, I thought it was a bug but I think I’m doing something wrong

I have an earnings table: id, cachet, timerstamp, user_id(band)
2 records with 350 and 250 euros
I have an expense table: id, amount, timestamp, user_id(band)
1 record with 50 euros

doing the LEFT join on id_user I have two results with the duplicate of the row spent 50 euros

Doing a CROSS join always on id_user I always find two results with the duplicate expenses.

Code : SELECT incassi.cachet, incassi.band, spese.importo, spese.band, incassi.timestamp, spese.timestamp FROM incassi left JOIN spese ON incassi.band=spese.band
Immagine 2022-02-08 093053

@TERzo you have this error because you are joining the two tables using a foreign key user_id(band), this means it will match with all the records with the same id. Read more about the join statements here SQL Joins (w3schools.com), here MySQL Join Made Easy For Beginners (MySQL tutorial), to understand more.

Thanks, problem solved