Jump to content
Fórum Script Brasil
  • 0

Update


Guest AD
 Share

Question

Tenho duas tabelas.. 1 com a informação correta e outra errada. Preciso acertar a errada.

Fiz esta query e está dando erro:

UPDATE SZG100

SET SZG100.ZG_TEL = SZG200.ZG_TEL

WHERE SZG100.ZG_NOME = SZG200.ZG_NOME

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Uso uma ferramenta de acesso ao banco chamada Aqua Data Studio, nela é informado:

>[Error] Script lines: 1-3 --------------------------

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[sZG100].ZG_NOME = [sZG200].ZG_NOME' at line 3

[Executed: 13/12/06 16h17min45s BRST ] [Execution: 0/ms]

No Sql Server, faria assim:

UPDATE titles

SET ytd_sales = t.ytd_sales + s.qty

FROM titles t, sales s

WHERE t.title_id = s.title_id

mas pelo que observei o Mysql não possui a çláusula FROM no UPDATE...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



  • Forum Statistics

    • Total Topics
      151k
    • Total Posts
      649.1k
×
×
  • Create New...