Ladies and Gents,
This is an query written for Oracle 7.3. What is the sub-query doing? My
take is that the sub query is returning the max shis_action_date PER ROW.
WHERE SERV_PREM_CODE = SHIS_PREM_CODE
AND SERV_NUM = SHIS_SERV_NUM
AND SERV_PREM_CODE = PREM_CODE
AND SERV_PREM_CODE = MAPS_CODE
AND SERV_CUST_CODE = CUST_CUST_CODE (+)
AND SHIS_ACTION_DATE =
WHERE SHIS_PREM_CODE = SERV_PREM_CODE
AND SHIS_SERV_NUM = SERV_NUM
AND SERV_READING_SEQ > 0
AND SERV_ROUTE <= 9000
AND SERV_ROUTE >= 1000
ORDER BY SERV_ROUTE ASC,
Re: Sub Query
"Rick" <firstname.lastname@example.org> wrote:
>Ladies and Gents,
>This is an query written for Oracle 7.3. What is the sub-query doing?
>take is that the sub query is returning the max shis_action_date PER ROW.
Your query will return all rows which have the latest shis_action_date and
NOT the max shis_action_date per row.
By latest shis_action_date I mean all the records for which the value of
the field 'shis_action_date' is equal to the max value determined in the
Hope this is clear
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL