Re: Populate Table From Two Other Tables

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Populate Table From Two Other Tables
Дата
Msg-id alpine.LNX.2.00.1206051623570.27613@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Populate Table From Two Other Tables  (Greg Williamson <gwilliamson39@yahoo.com>)
Ответы Re: Populate Table From Two Other Tables  ("David Johnston" <polobo@yahoo.com>)
Re: Populate Table From Two Other Tables  (Darren Duncan <darren@darrenduncan.net>)
Список pgsql-general
On Tue, 5 Jun 2012, Greg Williamson wrote:

> Try a single equals sign, e.g. WHERE c.site = s.siteid

Greg,

   I'm surprised: that worked! I thought the WHERE clause was looking for
equivalency, not an assignment.

   There's another problem now that will be more difficult to fix. Postgres
tells me, 'psql:populate-waterchem.sql:6: ERROR:  duplicate key value
violates unique constraint "waterchem_pkey"'. But, when I SELECT rows based
on the primary key only a single row is returned.

   I think the most parsimonious solution is to use an awk script to add the
stream and basin columns to the chemistry.txt file. That also eliminates
having to export the combined table to a text file.

Thanks,

Rich


В списке pgsql-general по дате отправления:

Предыдущее
От: Kraus Philipp
Дата:
Сообщение: acessibility for tables
Следующее
От: Mike Christensen
Дата:
Сообщение: Re: I'd like to learn a bit more about how indexes work