I want to run this code, but I get this message:" #1052 - Column 'name' in field list is ambiguous" UPDATE SC_CTACTE_TEMP s, (SELECT codigo, name, COUNT(1) cantidad FROM sc_temp_cuotas GROUP BY codigo HAVING COUNT( codigo ) > 0 ORDER BY codigo ASC) t1 SET cod_stud = t1.codigo, fec_mov_cta = "2016-04-30", periodo = "201604", cant_ejemplares = t1.cantidad, name = t1.name WHERE s.cod_stud = t1.codigo PHP: What is wrong?
Probably that you have multiple name-columns in the different tables. Prefix the name column with the table name.