Re: Creating composite keys from csv

Поиск
Список
Период
Сортировка
От John McKown
Тема Re: Creating composite keys from csv
Дата
Msg-id CAAJSdjgnrpcYb_hkt7pM7AWBTiOsf2g4RRmoMemaAFS-=TLkrw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Creating composite keys from csv  (Eli Murray <ejmurra2@illinimedia.com>)
Список pgsql-general
On Mon, Mar 9, 2015 at 10:12 AM, Eli Murray <ejmurra2@illinimedia.com> wrote:
> Thank you all for your help. I'm following along with John McKown's
> suggestion but when I run the update query I get "UPDATE 32956" but the
> personid column in my rawdata table has null values for every record.
>
> Here's the exact query I ran:
>
> UPDATE rawdata SET personid = (SELECT personid FROM assignid WHERE
> rawdata.personid = assignid.personid);

My apologies. I really messed that one up. And your analysis is
correct. I will plead "early morning brain failure". The UPDATE should
look like:

UPDATE CollegeData SET PersonID=SELECT PersonID from AssignID where
CollegeData.Name = AssignID.Name & CollegeData.TotalSalary =
AssignID.TotalSalary;

>
> I think the issue might be that it's only selecting records where personid
> is the same in both tables and right now there are only null values in
> rawdata.personid. What query should I write to SET rawdata.personid =
> assignid.personid WHERE rawdata.employeename && rawdata.totalsalary =
> assignid.name && assignid.totalsalary?
>

--
He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists
Следующее
От: Anushka Chandrababu
Дата:
Сообщение: Re: pg_conndefaults Returning empty string