[SQL] Which Approach Performs Better?

2003-03-24 Thread CN
Hi! I have a tree table: CREATE TABLE tree ( CONSTRAINT fktree FOREIGN KEY (parent) REFERENCES tree (dept), dept int primary key, --department parent int ); insert into tree values(1,1); insert into tree values(2,1); insert into tree values(3,2); and a history table: CREATE TABLE history (

[SQL] Complex outer joins?

2003-03-24 Thread Correia, Carla
Hi, I've got PsotgreSQL 7.3. My problem is joins. I've seen the syntax on joins and have sucessefully used SQLs with joins, but I've got some other big SQL statements using many and complex joins. Simplified example: select G.SELID, G.TEXT, L.ID as SELLEVELID , L.SELLEVEL,

Re: [SQL] Seeking help with a query....

2003-03-24 Thread Christoph Haller
Hi folks, seeking help with a query that I thought was simple, but apparantly isn't, at least for someone with my knowledge level. Given a table : create table atable ( code1 char, code2 char, costint ); And the rows code1code2cost - a

Re: [SQL] Complex outer joins?

2003-03-24 Thread Peter Childs
On Mon, 24 Mar 2003, Correia, Carla wrote: Hi, I've got PsotgreSQL 7.3. My problem is joins. I've seen the syntax on joins and have sucessefully used SQLs with joins, but I've got some other big SQL statements using many and complex joins. Simplified example: select G.SELID,

[SQL] UPDATE FROM portability

2003-03-24 Thread Andreas Pflug
Updating some rows in tab1 with corresponding values from tab2, pgsql style: UPDATE tab1 SET value=T2.VALUE FROM tab2 T2 WHERE T2.restr=1 AND tab1.key=T2.key The same for MSSQL: UPDATE tab1 SET value=T2.VALUE FROM tab1 T1 JOIN tab2 T2 ON

Re: [SQL] query 2 database

2003-03-24 Thread Christoph Haller
Can anybody help me, can't i make query 1 table in different database (but not schema) in postgre 7.3? see $PGSQLD/contrib/dblink/ Regards, Christoph ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an

[SQL] Complex outer joins?

2003-03-24 Thread Correia, Carla
Password: d5B9Av Hi, I've got PsotgreSQL 7.3. My problem is joins. I've seen the syntax on joins and have sucessefully used SQLs with joins, but I've got some other big SQL statements using many and complex joins. Simplified example: select G.SELID, G.TEXT, L.ID as SELLEVELID

Re: [SQL] Complex outer joins?

2003-03-24 Thread Correia, Carla
Sorry if I was not that clear...but in fact the (+) is the join operator in Oracle. The statement in question is about making 3 left outer joins on 3 diferent tables. G, L and C are in fact 3 diferent tables. Carla -Ursprüngliche Nachricht- Von: Peter Childs