Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2263F63236C for ; Thu, 22 Apr 2010 16:15:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75939-03 for ; Thu, 22 Apr 2010 19:14:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from n11.bullet.mail.ac4.yahoo.com (n11.bullet.mail.ac4.yahoo.com [74.6.228.83]) by mail.postgresql.org (Postfix) with SMTP id 48B21632292 for ; Thu, 22 Apr 2010 16:14:52 -0300 (ADT) Received: from [76.13.12.64] by n11.bullet.mail.ac4.yahoo.com with NNFMP; 22 Apr 2010 19:14:51 -0000 Received: from [74.6.228.82] by t5.bullet.mail.ac4.yahoo.com with NNFMP; 22 Apr 2010 19:14:51 -0000 Received: from [127.0.0.1] by omp1003.mail.ac4.yahoo.com with NNFMP; 22 Apr 2010 19:14:50 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 989549.97290.bm@omp1003.mail.ac4.yahoo.com Received: (qmail 79887 invoked by uid 60001); 22 Apr 2010 19:14:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1271963690; bh=ESMFN5XJPr5q8sC7e5FUC4PBP8AX0GqgxlL6Uy3QGrA=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=xKiiBLVuU/5AI/UVuxvz8g263nnGmhJT1iC9TXEt7utO9EIPaq2IKzHDthkbthe5ekXsAGn044q1kB7RUJ/mMXlAl3yo5DW4k64dIbfjhBKs0/thU1VCI8qWcFUbfkm5QgmJXdrzoBB3liHWbshjRcq5D40jPnlKcXfCpc1o2bo= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=y34FGQnT9sLNfhxBJaP+U2WMAuMuVpic9R4R2n3IB3slvVxgKveR40MSQF0jtv++A64dfMyFSC34cRr9hAfHok8K5k7LSsRIdmNZmRzR4x8D3WrHYnnk+Sg2VM5cWEL2UzDaslunsDhpMVXe5C8BZnGmSE+24fhcM5oMYomDFUo=; Message-ID: <815510.79882.qm@web59516.mail.ac4.yahoo.com> X-YMail-OSG: Hdye0soVM1nFp_.zTK4Uzf_P0FY7bcn6JqDqXvWgv3yXR4N DcF.uoBvfYzFCsijWVivP4NG39HanGdvY8d32LRVjnHGoyP2wKz27CIL0x1U JnDfeDC6Z8ogV5TVcxolYa.nWuPzd3ppf5EeKy26BaxfeF0_bfFH8GqzNaXq YjSS0YCQE_uR_FKCq1L8wv5QG8hXi5LlpwfAeEiuYAH0vJqeGTYhpNSe.aEJ BFNfz7IgKTbwjNRyfhbzMFWncMDyJ.gJvT6fNwnvfKmM- Received: from [161.196.80.48] by web59516.mail.ac4.yahoo.com via HTTP; Thu, 22 Apr 2010 12:14:50 PDT X-Mailer: YahooMailClassic/10.1.9 YahooMailWebService/0.8.102.267879 Date: Thu, 22 Apr 2010 12:14:50 -0700 (PDT) From: Lennin Caro Subject: Re: LEFT OUTER JOIN issue To: "'pgsql-sql@postgresql.org'" , Thomas BOURIMECH In-Reply-To: <5AF59BAE41BBA14090A31CE077580C53238EAB6FD5@EXCHANGE2007.netcenter.local> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-335168115-1271963690=:79882" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.009 tagged_above=-10 required=5 tests=BAYES_20=-0.001, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/87 X-Sequence-Number: 34014 --0-335168115-1271963690=:79882 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable --- On Wed, 4/21/10, Thomas BOURIMECH wrote: From: Thomas BOURIMECH Subject: [SQL] LEFT OUTER JOIN issue To: "'pgsql-sql@postgresql.org'" Date: Wednesday, April 21, 2010, 9:06 AM =0A=0A=0A =0A =0A=0A=0A=0A=0A=0A=0AHi=A0 everyone, here is my problem : = =0A=0A =A0 =0A=0AI got two tables : =0A=0A =A0 =0A=0ACREATE TABLE=0A"public= "."calendar_temp" ( =0A=0A=A0 "id" SERIAL, =0A=0A=A0 "dat" DATE, =0A=0A= =A0 "heur" TIME WITHOUT TIME=0AZONE, =0A=0A=A0 CONSTRAINT=0A"calendar_temp= _pkey" PRIMARY KEY("id") =0A=0A) WITHOUT OIDS; =0A=0A =A0 =0A=0A =A0 =0A=0A= CREATE TABLE "public"."h_part"=0A( =0A=0A=A0 "idh" SERIAL, =0A=0A=A0 "post= e_idposte" INTEGER=0ANOT NULL, =0A=0A=A0 "t" NUMERIC(4,1), =0A=0A=A0 "heu= remesure" TIME WITHOUT=0ATIME ZONE, =0A=0A=A0 "datmesure" DATE, =0A=0A=A0= CONSTRAINT "h_part_datmesure_key"=0AUNIQUE("datmesure", "heuremesure",=0A"= poste_idposte"), =0A=0A=A0 CONSTRAINT "h_part_pkey"=0APRIMARY KEY("idh"), = =0A=0A=A0 CONSTRAINT "h_part_fk"=0AFOREIGN KEY ("poste_idposte") =0A=0A=A0= REFERENCES=0A"public"."poste"("idposte") =0A=0A=A0 ON DELETE NO ACTION =0A= =0A=A0 ON UPDATE NO ACTION =0A=0A=A0 NOT DEFERRABLE =0A=0A) WITHOUT OIDS; = =0A=0A =A0 =0A=0A =A0 =0A=0AData in table are like this : =0A=0A =A0 =0A=0A= calendar_temp =0A=0A----------------- =0A=0Aid=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=0Adat=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=0Aheur =0A=0A1=A0=A0=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0=A0=A0=A0=A0=0A15/03/2008 =0A=0A5003=A0=A0=A0=A0=A0=0A275=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=0A15=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 6:00=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=0A15/03/2008 =0A=0A5004=A0=A0=A0=A0=A0=0A275=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=0A18=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 9:00=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=0A15/03/2008 =0A=0A =A0 =0A=0AI expect the following dat= a set as a result=0Afrom the following request : =0A=0A =A0 =0A=0ASELECT= =0Act.dat,ct.heur,hp.datmesure,hp.heuremesure,hp.t FROM calendar_temp as ct= =0A=0ALEFT OUTER JOIN h_part as hp =0A=0AON ct.dat =3D hp.datmesure =0A=0A= ABD ct.heur =3D hp.heuremesure =0A=0AWHERE =0A=0Ahp.poste_idposte =3D 275 = =0A=0AORDER BY ct.dat, ct.heur =0A=0A =A0 =0A=0Adat=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=0Aheur=A0=A0=A0=A0=A0=0Ada= tmesure=A0=A0=A0=A0=A0=A0=A0=A0 heuremesure =A0 t =0A=0A-------------------= ---------------------------------------- =0A=0A15/03/2008=A0=A0=A0=A0=A0=A0= =A0=A0=0A0:00=A0=A0=A0=A0=A0=A0=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A0:00= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=0A8,3 = =0A=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A3:00=A0=A0=A0=A0=A0=A0=0A15/03/2= 008=A0=A0=A0=A0=A0=A0=A0=A0=0A3:00=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=0A12 =0A=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0= =0A6:00=A0=A0=A0=A0=A0=A0=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A6:00=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=0A15 =0A=0A15/= 03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A9:00=A0=A0=A0=A0=A0=A0=0A15/03/2008=A0=A0= =A0=A0=A0=A0=A0=A0=0A9:00=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=0A18 =0A=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A12:00=A0= =A0=A0=A0 null=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=0Anull=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=0Anull =0A=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A15:00=A0=A0= =A0=A0=0Anull=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=0Anull=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=0Anull =0A=0A =A0 =0A=0A =A0 =0A=0ABut unfortunatly all that I= get is=0A=A0this set : =0A=0A =A0 =0A=0Adat=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=0Aheur=A0=A0=A0=A0=A0=0Adatmesur= e=A0=A0=A0=A0=A0=A0=A0=A0 heuremesure =A0 t =0A=0A-------------------------= ---------------------------------- =0A=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0= =0A0:00=A0=A0=A0=A0=A0=A0=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A0:00=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=0A8,3 =0A=0A15= /03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A3:00=A0=A0=A0=A0=A0=A0=0A15/03/2008=A0= =A0=A0=A0=A0=A0=A0=A0=0A3:00=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=0A12 =0A=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A6:00= =A0=A0=A0=A0=A0=A0=0A15/03/2008=A0=A0=A0=A0=A0=A0=A0=A0=0A6:00=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=0A15 =0A=0A15/03/200= 8=A0=A0=A0=A0=A0=A0=A0=A0=0A9:00=A0=A0=A0=A0=A0=A0=0A15/03/2008=A0=A0=A0=A0= =A0=A0=A0=A0=0A9:00=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=0A18 =0A=0A =A0 =0A=0A =A0 =0A=0AGetting mad with it... =0A=0A= =A0 =0A=0AThanks for any help... =0A=0A =A0 =0A=0A try.. SELECT=20 =A0=A0=A0=A0 ct.dat,ct.heur,hp.datmesure,hp.heuremesure,hp.t=20 FROM=20 =A0=A0 calendar_temp as ct=0A =0A=0ALEFT JOIN=20 =A0=A0 h_part as hp ON (ct.dat =3D hp.datmesure and ct.heur =3D hp.heuremes= ure) =0A=0AWHERE =0A=0A=A0=A0 hp.poste_idposte =3D 275=0A =0A=0AORDER BY ct= .dat, ct.heur =0A=0A=0A=0A =0A=0A=0A=0A=0A --0-335168115-1271963690=:79882 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
--- On Wed, 4/21/10, Thomas BOURIMECH &= lt;thomas.bourimech@metnext.com> wrote:

From: Thomas BOURIMECH <thomas.bourimech@metnext.com>
Subj= ect: [SQL] LEFT OUTER JOIN issue
To: "'pgsql-sql@postgresql.org'" <pg= sql-sql@postgresql.org>
Date: Wednesday, April 21, 2010, 9:06 AM
<= br>
=0A=0A=0A =0A =0A