Oh my fault I misinterpreted the query. USING(no_pedido) is fine.
Can you post the results of SHOW CREATE TABLE table1
and for each table? So I can see the full schema and extent of the relationships. Perhaps all you really want or need is a foreign key here, but I need to how these tables interrelate.
If the tables are very wide with a lot of columns, just make sure you include the definitions of any columns used in a JOIN (like no_pedido, cod_prod_cliente, cod_prod) and anything used in a WHERE clause at minimum.