Hi David,
David Ruggles wrote:
Supplyorder
uid double (auto) (pk)
sitedouble
datedate
Supplyorderhistory
uid double (auto) (pk)
supplyorderuid double
status double
Supplyorderlineitems
uid double (auto) (pk)
es
Cc: 'mysql'
Subject: Re: Selecting records based on max and value
David,
>I want to select for a given date all sites that have
>the last history record with a certain status.
Try something like ...
SELECT h1.supplyorderid
FROM supplyorder o
JOIN supplyorderhistory h1 ON o.
David,
I want to select for a given date all sites that have
the last history record with a certain status.
Try something like ...
SELECT h1.supplyorderid
FROM supplyorder o
JOIN supplyorderhistory h1 ON o.uid=h1.supplyorderuid
LEFT JOIN supplyorderhistory h2
ON h2.supplyorderuid = h.supply