Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORACLE 12C - SQL QUERY - SELECT MAX DATE ROW

SANPATJul 10 2020 — edited Jul 10 2020

Dear friends

I want to select he the record whose date is max , currently i had written the query in the following way, i would like to know is there any other method where always i can getting the correct data with the latest date.

SELECT      T."PRODUCT_CODE",T."PRODUCT_DESCRIPTION",T."CUSTOMER",T."CUSTOMER_NAME",T."CONSIGNEE",T."CONSIGNEE_NAME",T."SALES_UOM",T."PRICE_UOM",T."RAT     E",T."CURRENCY_CODE",T."EFFECTIVE_FROM",T."DISCOUNT_TYPE",T."DISCOUNT_VALUE",T."VAT",T."VAT_PER",T."STATUS",T."ADD_DATE",T."MOD_DATE",T."ADD_USER",     T."MOD_USER"

FROM fds_customer_rate T

     WHERE Effective_from=

          (SELECT MAX(Effective_from)

                    FROM fds_customer_rate

                              WHERE Product_Code=T.Product_Code);

Sanjay

This post has been answered by Tubby on Jul 10 2020
Jump to Answer
Comments
Post Details
Added on Jul 10 2020
1 comment
4,992 views