RE: Simple SQL-syntax
От
Robby Slaughter
Тема
RE: Simple SQL-syntax
Дата
Msg-id
EPEHLKLEHAHLONFOKNHNMEPEDEAA.webmaster@robbyslaughter.com
Ответ на
Simple SQL-syntax (Fredrik Thunberg)
Список
Дерево обсуждения
RE: Simple SQL-syntax "Michael Ansley (UK)" <Michael.Ansley@intec-telecom-systems.com>
Fredrik, Just for future reference, it's generally a good idea to include a complete table schema and some sample data for your tables when asking this kind of question. But I think I know what you mean and will try to help you. >Suppose I have Table A looking something like this: >Index Text NrA >And Table B like this: >NrA NrB >Then I want to change all occurences of NrA in Table A to NrB... First of all, your syntax isn't quite right. It's UPDATE tablename SET value = value WHERE [conditions]; There's no FROM clause in an update statement. And second, you need to be careful to make sure all your tokens make sense. You had an extra "B" in the middle of your statement. Based on this: UPDATE tableA,tableB SET tableA.NrA = tableB.NrB WHERE tableA.NrA = tableB.NrB should achieve the desired result. Hope this helps! -Robby Slaughter
В списке pgsql-sql по дате отправления