Hi, > SELECT ct.dat,ct.heur,hp.datmesure,hp.heuremesure,hp.t FROM calendar_temp as ct > LEFT OUTER JOIN h_part as hp > ON ct.dat = hp.datmesure > AND ct.heur = hp.heuremesure > WHERE > hp.poste_idposte = 275 > ORDER BY ct.dat, ct.heur > dat heur datmesure heuremesure t > ----------------------------------------------------------- > 15/03/2008 0:00 15/03/2008 0:00 8,3 > 15/03/2008 3:00 15/03/2008 3:00 12 > 15/03/2008 6:00 15/03/2008 6:00 15 > 15/03/2008 9:00 15/03/2008 9:00 18 > 15/03/2008 12:00 null null null > 15/03/2008 15:00 null null null
Would this work? SELECT ct.dat,ct.heur,hp.datmesure,hp.heuremesure,hp.t FROM calendar_temp as ct LEFT OUTER JOIN h_part as hp ON ct.dat = hp.datmesure AND ct.heur = hp.heuremesure WHERE coalesce(hp.poste_idposte,275) = 275 ORDER BY ct.dat, ct.heur dat | heur | datmesure | heuremesure | t ------------+----------+------------+-------------+------ 2008-03-15 | 00:00:00 | 2008-03-15 | 00:00:00 | 8.3 2008-03-15 | 03:00:00 | 2008-03-15 | 03:00:00 | 12.0 2008-03-15 | 06:00:00 | 2008-03-15 | 06:00:00 | 15.0 2008-03-15 | 09:00:00 | 2008-03-15 | 09:00:00 | 18.0 2008-03-15 | 12:00:00 | | | 2008-03-15 | 15:00:00 | | | (6 rows) Regards, Jayadevan DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."