2 Replies Latest reply on Jan 25, 2021 9:27 PM by Krishnan Sreekandath

    Rank records based on ID's joining two different database tables

    ranjitha DB New Member

      Hi,

       

      I have a requirement to set the delivery for orders based on dates joining two tables

       

      Please find the attachment having the scenarios explained

       

      Any suggestions

      I appreciate your quick help

       

      Thanks in advance!!

        • 1. Re: Rank records based on ID's joining two different database tables
          Krishnan Sreekandath Seasoned Veteran

          Hello Ranjitha,

           

          Unfortunately, the requirement does not seem to be clear.

           

          Can you please elaborate a bit ?

           

          scenario1
          IDPLAN_IDdoc_typeDelivery_typechange_dtplan_idIDexpected
          12362345xyzhome12/13/202012345123planiddelivery
          123*xyzofficenull6234512312345home
          8765412362345office
          87654office
          scenario2
          IDPLAN_IDdoc_typeDelivery_typechange_dtplan_idIDexpected
          12362345xyzhome12/13/202012345123planiddelivery
          123*xyzoffice12/10/20206234512312345office
          12312345xyzhome8/12/20208765412362345home
          87654office

           

           

          "if suppose * has the highest change_dt in Table A then all the plans in Table B should have the delivery type same as * in Table A"

           

          This can be achieved by fetching the max(change_dt) from the source and then joining it with the data in Table B based on the join condition (like plan_id).

           

          "if suppose any planId in Table A is having highest change date then only the corresponding plan delivery type should be assigned rest all other plans should have same as * delivery type like in scenario 2"

           

          Can you please explain the requirement here ?

           

          Thanks,

          Krishnan

          • 2. Re: Rank records based on ID's joining two different database tables
            Krishnan Sreekandath Seasoned Veteran

            Hello Ranjitha,

             

            Please do elaborate on the requirement when you get a chance.

             

            If you might have implemented/resolved this already, please do post the solution here so that it might be helpful for others later on.

             

            Thank you,

            Krishnan