From: justin <justin@emproshunts.com>
To: Oliveiros C, <oliveiros.cristina@marktest.pt>
Cc: pgsql-sql@postgresql.org
Cc: gary.stainburn@ringways.co.uk
Subject: Re: simple (?) join
Date: Sat, 26 Sep 2009 14:53:24 -0400
Message-ID: <4ABE6324.3060601@emproshunts.com> (raw)
In-Reply-To: <1EF7ADDE66AA4D4E8E7EB2021CAD6CBB@marktestcr.marktest.pt>
References: <200909241616.36933.gary.stainburn@ringways.co.uk>
<20090924194629.44bc236f@dwnoon.ntlworld.com>
<4ABBD34B.9080600@emproshunts.com>
<1EF7ADDE66AA4D4E8E7EB2021CAD6CBB@marktestcr.marktest.pt>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Oliveiros C, wrote:
<blockquote
cite="mid:1EF7ADDE66AA4D4E8E7EB2021CAD6CBB@marktestcr.marktest.pt"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.5730.13" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Hello, Justin, Gary.</font></div>
<div> </div>
<div><font face="Arial" size="2">Justin, your (the second one) query
is not much different from mine.</font></div>
</blockquote>
No its not, <br>
<blockquote
cite="mid:1EF7ADDE66AA4D4E8E7EB2021CAD6CBB@marktestcr.marktest.pt"
type="cite">
<div><font face="Arial" size="2"> You previewed the possibility of
having orders without any matching entry on orders_log with your left
join, something that I haven't. Gary, will you have</font></div>
<div><font face="Arial" size="2">records on your orders table that
don't reference any record on your orders_log table? If so, Justin's
query is the right one you should use.</font></div>
<div> </div>
<div><font face="Arial" size="2">You return the full record from
orders and an additional column from orders_log, the ol_timestamp
column. I understood that Gary wanted the full record from orders_log,
not</font></div>
<div><font face="Arial" size="2">just the timestamp column. That
part is done by my subquery .</font></div>
<div> </div>
<div><font face="Arial" size="2"> I think Gary could clarify what he
wants exactly. Gary? :)</font></div>
</blockquote>
Yes gary please do if these do not answer your questions???<br>
<blockquote
cite="mid:1EF7ADDE66AA4D4E8E7EB2021CAD6CBB@marktestcr.marktest.pt"
type="cite">
<div> </div>
<div><font face="Arial" size="2">Also, Justin, your query
design seems right to me, but maybe you should add this (the part in
comment) to your subquery </font></div>
<div>SELECT MAX(ol_timestamp) /* as ol_timestamp */ , o_id FROM
orders_log group by o_id </div>
<div>because the MAX(ol_timestamp) will receive the name max, not
ol_timestamp, and probably</div>
<div>the parser will complain that column ol_timestamp does not
exist.</div>
<div>Ain't I right?</div>
</blockquote>
<br>
Yes you are correct i forgot to add the AS <br>
</body>
</html>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: justin@emproshunts.com, oliveiros.cristina@marktest.pt, gary.stainburn@ringways.co.uk
Subject: Re: simple (?) join
In-Reply-To: <4ABE6324.3060601@emproshunts.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox