Re: [GENERAL] Creating composite keys from csv

2015-03-09 Thread John McKown
On Mon, Mar 9, 2015 at 10:12 AM, Eli Murray 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 ra

Re: [GENERAL] Creating composite keys from csv

2015-03-09 Thread Eli Murray
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 assig

Re: [GENERAL] Creating composite keys from csv

2015-03-09 Thread Adrian Klaver
On 03/08/2015 08:49 PM, Eli Murray wrote: Hi all, I'm a student journalist working on a project for our student paper which lists salaries and positions for every staff member at the university. We received the data from an FOI request but the university is refusing to give us primary keys for t

Re: [GENERAL] Creating composite keys from csv

2015-03-09 Thread John McKown
On Sun, Mar 8, 2015 at 10:49 PM, Eli Murray wrote: > Hi all, > > I'm a student journalist working on a project for our student paper which > lists salaries and positions for every staff member at the university. We > received the data from an FOI request but the university is refusing to give > us

Re: [GENERAL] Creating composite keys from csv

2015-03-08 Thread John R Pierce
On 3/8/2015 10:32 PM, David G Johnston wrote: This solves the explicit problem given the assumption that (Name, Total Salary) is indeed a uniquely identifying constraint. that constraint seems flawed to me. -- john r pierce 37N 122W somewhere on the middle

Re: [GENERAL] Creating composite keys from csv

2015-03-08 Thread David G Johnston
Eli Murray wrote > Basically, what we'd like to do is create a serial primary key but instead > of having it increment every row, it needs to check the name and total > salary columns and only increment if that person doesn't already exist. So you already have a PK, (Name, Total Salary), but the s

Re: [GENERAL] Creating composite keys from csv

2015-03-08 Thread Roxanne Reid-Bennett
On 3/8/2015 11:49 PM, Eli Murray wrote: Hi all, I'm a student journalist working on a project for our student paper which lists salaries and positions for every staff member at the university. We received the data from an FOI request but the university is refusing to give us primary keys for

[GENERAL] Creating composite keys from csv

2015-03-08 Thread Eli Murray
Hi all, I'm a student journalist working on a project for our student paper which lists salaries and positions for every staff member at the university. We received the data from an FOI request but the university is refusing to give us primary keys for the data. The issue we've run into is that i