| От | John Coryat |
|---|---|
| Тема | Complex Update |
| Дата | |
| Msg-id | 3FF6896E.3010602@coryat.com обсуждение исходный текст |
| Ответы |
Re: Complex Update
|
| Список | pgsql-sql |
Problem: I have a table that has a field I want to plug with a value from other tables. I can do it with a perl program and a loop, but want to do it with a single SQL statement. Is there a way to do an update that combines a select statement containing a "where" that uses a field from the row to be updated? I would expect it to look something like this: update orderheader set total = (select sum(amount) from orderdetail where orderdetail.orderno=orderheader.orderno) ; Any ideas?
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера