Re: [SQL] null foreign key column

2003-02-12 Thread Dmitry Tkach
Vernon Wu wrote: 12/02/2003 2:24:49 PM, Dmitry Tkach <[EMAIL PROTECTED]> wrote: You don't want it to be serial - just make it 'person_id in' Any reasons? Yeah... Two of them: - It does not make sense for a serial column to reference other tables - the only purpose of serial is to g

Re: [SQL] null foreign key column

2003-02-12 Thread Vernon Wu
12/02/2003 2:24:49 PM, Dmitry Tkach <[EMAIL PROTECTED]> wrote: >You don't want it to be serial - just make it 'person_id in' Any reasons? > >I hope, it helps... > >Dima > >Arunachalam Jaisankar wrote: >> This is a multi-part message in MIME format. >> >> --=_NextPart_000_0005_01C2D1EE.6199

[SQL] Possible bug in Postgres? Followup to "How do you select from a table until a condition is met?"

2003-02-12 Thread Nicholas Allen
Ok I have decided that this is the best way to do it. Assuming I have a column (or a few columns) which can uniquely define a row I should be able to select up to a known row with a clever where clause. For example a table contains the following dummy data (the combination of s_alias and s_login

Re: [SQL] How do you select from a table until a condition is met?

2003-02-12 Thread Nicholas Allen
Ok I thought of that but what happens if there is no primary key in the table? I can probably add primary keys to the table but I didn't design the tables and so I have little (but luckily some) say over what columns appear in them. What has actually happened is that we have a view on a table an

Re: [SQL] null foreign key column

2003-02-12 Thread Dmitry Tkach
You don't want it to be serial - just make it 'person_id in' I hope, it helps... Dima Arunachalam Jaisankar wrote: This is a multi-part message in MIME format. --=_NextPart_000_0005_01C2D1EE.61998D70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-pr

[SQL] How do you select from a table until a condition is met?

2003-02-12 Thread Nicholas Allen
Hi, I am hoping that someone can help me with a problem I have. I would like to be able to perform a SELECT query to select values from a table upto a certain row. The select may be ordered on a number of items. Is it possible to do this and how should I do it? The reason I need this is becaus