<!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(at)marktestcr(dot)marktest(dot)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(at)marktestcr(dot)marktest(dot)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(at)marktestcr(dot)marktest(dot)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>