[SQL] Order of precedence between AND and OR.

2005-11-25 Thread David Pradier
etween AND and OR, that is if the AND expression is calculated before the OR one, or anyelse way. Could somebody tell me or point me to the right doc ? Thanks in advance, David -- David Pradier -- Directeur Technique de Clarisys Informatique -- Chef de projet logiciels libres / o

Re: [SQL] Design problemi : using the same primary keys for inherited objects.

2005-10-17 Thread David Pradier
e, m_name, l_name, > email_addr, uname, upwd) VALUES (3, 1, 'Marilyn', '', 'Monroe', > '[EMAIL PROTECTED]', 'mmonroe', 'mmonroe'); > INSERT INTO sys_user(sys_client_id, lu_user_type, f_name, m_name, l_name, > email_addr, uname, upwd

Re: [SQL] Design problem : using the same primary keys for inherited objects.

2005-10-17 Thread David Pradier
pecified that not two laboratories could be the same actor, for example. That's why i think having a primary key referencing another primary key could technically work, but well, it seems to me BAD to mix two primary keys together. I'm still wondering... -- David Pradier -- Directeur Techniqu

Re: [SQL] Design problem : using the same primary keys for inherited objects.

2005-10-17 Thread David Pradier
#x27;person' : user, physician, customer, etc... Do you continue to think that inheritance is the wrong relationship type here ? > It *is* a bad design. You should not do this. After all, how is that > any different than this? Well, not every line of actor are in laborato

Re: [SQL] Design problem : using the same primary keys for inherited objects.

2005-10-14 Thread David Pradier
EY, arg1 type1, arg2 type2 ) CREATE TABLE person ( id_person INTEGER PRIMARY KEY REFERENCES actor, arg3 type3, arg4 type4 ) Don't you think it is a BAD design ? If it isn't, well, it will expand my database practices. David -- David Pradier -- Directeur Technique de Clarisys Inf

[SQL] Design problemi : using the same primary keys for inherited objects.

2005-10-14 Thread David Pradier
e D instance the same id 12343. It's possible as two instances of an object never inherit from a same instance of another object. The id seems to me absolutely bad, but I wouldn't know how to phrase why. Any suggestion ? Thanks in advance, David. -- David Pradier -- Directeur Techn

Re: [SQL] UPDATEABLE VIEWS ... Examples?

2005-06-20 Thread David Pradier
> >This is maybe a newbie question, but what is the difference with a > >materialized view ? > > As I understand it (and that understanding may be wrong) a > materialized view is a table that holds the values of a view from > some point in time. A view is a "saved" subselect. Everything you

Re: [SQL] UPDATEABLE VIEWS ... Examples?

2005-06-20 Thread David Pradier
> > This is maybe a newbie question, but what is the difference with a > > materialized view ? > > An updateable view is one you can insert, delete or update rows. > A materialized view is one that is pre-executed... i mean, that the > data is stored in a file for fast execution of the view Thank

Re: [SQL] UPDATEABLE VIEWS ... Examples?

2005-06-20 Thread David Pradier
> Reading through the docs, both the CREATE VIEW and CREATE RULE pages refer > to how you can use a RULE to 'simulate' an updateable VIEW ... but I can't > seem to find any examples of this ... This is maybe a newbie question, but what is the difference with a materialized view ? David -- [EMA

Re: [SQL] How to make a IN without a table... ?

2003-06-16 Thread David Pradier
> > I avoid as hell to use temporary tables. This is part of a complex > > database, with more than 250 different tables. So i don't even want to > > think about adding temporary tables, brrr ! > > Just FYI, temporary tables in pgsql are invisible to other connections > even if they have the same

Re: [SQL] How to make a IN without a table... ?

2003-06-12 Thread David Pradier
On Thu, Jun 12, 2003 at 02:37:00PM +0200, Christoph Haller wrote: > > > > Like "Tell me how much i spent between the 4th and the 7th og this > month > > ?" uses 4 and 7 as arguments, but need to fetch the datas in the > > database. > > Clear enough ? :-) > Yes. > > > > What do you mean by table fun

Re: [SQL] How to make a IN without a table... ?

2003-06-12 Thread David Pradier
On Thu, Jun 12, 2003 at 02:10:06PM +0200, Christoph Haller wrote: > > > > These values are not taken in a table, but put in directly. > > > > I guess i wasn't clear enough. > > "my_function" here is a function which calculate some results about > some > > datas from the database. > > Example : a fu

Re: [SQL] How to make a IN without a table... ?

2003-06-12 Thread David Pradier
On Thu, Jun 12, 2003 at 07:09:29AM -0500, Bruno Wolff III wrote: > On Thu, Jun 12, 2003 at 13:50:27 +0200, > David Pradier <[EMAIL PROTECTED]> wrote: > > > > I guess i wasn't clear enough. > > "my_function" here is a function which calculate some r

Re: [SQL] How to make a IN without a table... ?

2003-06-12 Thread David Pradier
On Thu, Jun 12, 2003 at 01:16:27PM +0200, Christoph Haller wrote: > > > > i ran today in a problem when doing some (i mean too much for me) > advanced sql... > > > > What i want to do is something like this: > > > > SELECT > > my_var1, > > my_var2, > > my_function(my_var1, my_var2

[SQL] How to make a IN without a table... ?

2003-06-12 Thread David Pradier
Hi everybody, i ran today in a problem when doing some (i mean too much for me) advanced sql... What i want to do is something like this: SELECT my_var1, my_var2, my_function(my_var1, my_var2) FROM ( SELECT '1', '2',

[SQL] How to make a IN without a table... ?

2003-06-08 Thread David Pradier
Hi everybody, i ran today in a problem when doing some (too much for me) advanced sql... What i want to do is something like this: SELECT my_var1, my_var2, my_function(my_var1, my_var2) FROM ( SELECT '1', '2', '3',