Subject | Subselect |
---|---|
Author | Dion |
Post date | 2006-01-19T13:59:26Z |
I need to return a max value per record plus another field in subselect. Is
this possible?
Eg :-
select forklift.oid, forklift.name as forkliftname, forklift.forkliftcell,
(select max(h.totalhrs) from hrsworked h
where (h.forkliftoid = forklift.oid) and
(h.contractoid = contract.oid)
group by h.forkliftoid) as HoursStart,�
I effectively want the following:-
(select max(h.totalhrs), InvoiceDate from hrsworked h �
In other words, how would I return both the max housrs as well as the
associated InvoiceDate value for that record(max)?
Many thanks,
Dion.
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.20/234 - Release Date: 2006/01/18
[Non-text portions of this message have been removed]
this possible?
Eg :-
select forklift.oid, forklift.name as forkliftname, forklift.forkliftcell,
(select max(h.totalhrs) from hrsworked h
where (h.forkliftoid = forklift.oid) and
(h.contractoid = contract.oid)
group by h.forkliftoid) as HoursStart,�
I effectively want the following:-
(select max(h.totalhrs), InvoiceDate from hrsworked h �
In other words, how would I return both the max housrs as well as the
associated InvoiceDate value for that record(max)?
Many thanks,
Dion.
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.20/234 - Release Date: 2006/01/18
[Non-text portions of this message have been removed]