2 Replies Latest reply: Jun 7, 2012 12:03 AM by Manish Kukreti RSS

    Script

      I Have a table  in the following format:

       

      FirstName,LastName , Address,SSN

       

       

      I want to take a resident of the above table and get the data only where SSN is maximum??????

      Please help

        • Re: Script

          Hi,

           

          tempTable:
          LOAD * INLINE [
              FirstName, LastName, Address, SSN
              a, a, a, 1
              b, b, b, 2
              c, c, c, 3
              d, d, d, 3
          ];

           

          tempTable1: //This table loads only one entry with max SSN
          First 1 Load
          FirstName as tempFirstName,
          LastName as tempLastName,
          Address as tempAddress,
          SSN as tempSSN
          Resident tempTable order by SSN desc;

           

          LET maxSSN=FieldValue('tempSSN',1); //Getting the maxSSN

           

          finalTable:
          NoConcatenate  //Make sure it does not concatenate with tempTable
          Load *
          resident tempTable where SSN=$(maxSSN);

           

          Drop table tempTable;
          Drop table tempTable1;

           

          Is that what you are looking for?

           

          Regards,

          Xue Bin