Insert excel column in a table in Mysql

Asked

Viewed 746 times

1

I have a mysql table(has 600 records): inserir a descrição da imagem aqui

The column duvet is a column that will be extracted from an excel cell, (Mysql for Excel), doesn’t have the update option to just add and when I add the cell it’s like I add more records. Is there any tool where it is possible to update using Excel cell?

  • You can import this excel data into a new table, then update it (Mysql to Mysql table).

  • Our solution is simpler than I thought,would write an answer with an example of what would be the query and I take the opportunity to accept the answer,since you helped me.

1 answer

2


I believe there will be no major differences from Sql to the Mysql, for the example I created in SQL. Well, in the example imagine that the Table matches the table you already imported, the Table will be the new imported table and will have the value of the edr_id column to be used to update the respective field in the Table. Follow the statement (Sql):

update
  TabelaA
set
  edr_id = TabelaB.edr_id
from
  TabelaA
    inner join
  TabelaB
     on TabelaA.dados_cidades_id = Tabelab.dados_cidade_id

If you have any criteria be sure to use the WHERE clause.

  • 1

    Obrigado pela ajuda a query que resolveu o problema caso alguém precise no MySQL foi:
update
 dados_cidades
inner join
 lalaa
 on dados_cidades.dados_cidades_id = lalaa.lalaa_id
set
 dados_cidades.edr_id = lalaa.edr_id

Browser other questions tagged

You are not signed in. Login or sign up in order to post.