Re: [SQL] update with subselect (long)

2005-03-17 Thread Leif B. Kristensen
On Thursday 17 March 2005 15:01, Stephan Szabo wrote: > The above needs some work. The below should be acceptable to the > system. > > update name_parts set name_part_type=5 from (select name_id from > name_parts where name_part_type=6) as gpt_type where > name_parts.name_id=gpt_type.name_id and

Re: [SQL] update with subselect (long)

2005-03-17 Thread Stephan Szabo
On Thu, 17 Mar 2005, Leif B. Kristensen wrote: > CREATE TABLE name_part_types ( -- a key/label pair > name_part_type_id INTEGER PRIMARY KEY, > name_part_type VARCHAR(50) > ); > > > CREATE TABLE names ( -- one person can have multiple names > name_id INTEGER PRIMARY KEY, > person_i

Re: [SQL] update with subselect (long)

2005-03-17 Thread Leif B. Kristensen
On Thursday 17 March 2005 14:07, Leif B. Kristensen wrote: > slekta=> update name_parts set name_part_type=6 where > name_part_type=3; This message was sent a little prematurely while I was editing a similar posting to comp.databases. The cited line is erroneous and should read: > slekta=> upda

[SQL] update with subselect (long)

2005-03-17 Thread Leif B. Kristensen
Hello all, I'm working with a genealogy database where I try to implement a somewhat unconventional model for names. The purpose is to allow different naming styles, especially the old Norwegian naming style with Given name/Patronym/Toponym instead of the Given/Patronym style that appears as Go