<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SQL Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141983#M1906244</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try the subquery option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write select as below -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select key_field1 key_field2 key_filed3 max(date) max(time) field4 from &amp;lt;table name&amp;gt;&lt;/P&gt;&lt;P&gt;into corresponding fields of table &amp;lt;tablename&amp;gt;&lt;/P&gt;&lt;P&gt;where key_field1 in ( select key_field1&amp;nbsp; where key_field1 in s_key_field1)&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key_field2 in &lt;SPAN style="font-size: 13.3333330154419px;"&gt;( select key_field2&amp;nbsp; where key_field1 in s_key_field2).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assumptions : Only one unique combination of key_field1 and key_field2 will exist as shown by your data sample.&lt;/P&gt;&lt;P&gt;Also i have denoted the input values via select options s_key_field1 and s_key_field2. The aggregation function works with Date and Time type fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Jun 2015 03:08:05 GMT</pubDate>
    <dc:creator>Ankit_Maskara</dc:creator>
    <dc:date>2015-06-21T03:08:05Z</dc:date>
    <item>
      <title>SQL Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141981#M1906242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 543px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="105"&gt;&lt;STRONG&gt;KeyField1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="93"&gt;&lt;STRONG&gt;KeyField2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="110"&gt;&lt;STRONG&gt;KeyField3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="107"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;&lt;STRONG&gt;Time&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;&lt;STRONG&gt;Field4&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;F11&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;P&gt;F21&lt;/P&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20150101&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;131000&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;F4A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;F11&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;F21&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20150201&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;104000&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;F4B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;F11&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;F21&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20150301&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;112000&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;F4C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;F11&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;F21&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;4&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;20150301&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;172000&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;F4D&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;F12&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;F22&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20150103&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;154000&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;F4L&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;F12&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;F22&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20141012&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;045300&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;F4S&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000; font-size: 13.3333330154419px;"&gt;F12&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="font-size: 13.3333330154419px; color: #ff0000;"&gt;F22&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;7&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;20150606&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000;"&gt;224000&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;H3&gt;&lt;SPAN style="color: #ff0000; font-size: 13.3333330154419px;"&gt;F4C&lt;/SPAN&gt;&lt;/H3&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;F12&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;F22&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20150509&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;113700&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;F4d&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;F13&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;...&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;F14&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;...&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;.......&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;...&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;.......&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.....&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have above fields in my table.&lt;/P&gt;&lt;P&gt;User can give input of Key fields 'Key Field1' and 'KeyField2' .&lt;/P&gt;&lt;P&gt;For example user has passed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Key Field1 in('F11', 'F12')&amp;nbsp; and &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333330154419px;"&gt;Key Field2 in('F21', 'F22') &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I require the latest one in these based on date and time i.e records highlighted in red with bigger font.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this can be done by getting the records with input key fields into internal table then sorting them by&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;KeyField1 Keyfield2 ASCENDING&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Date Time Descending&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and deleting adjacent duplicates comparing KeyField1 and KeyField2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are many similar way of dealing with this after bringing after bringing it into internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way in Open SQL where we can get the exact required data(i.e the two records highlighted)&lt;/P&gt;&lt;P&gt;without getting additional records into application layer. The filtering sould occur at DB layer itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards,&lt;/P&gt;&lt;P&gt;Sandeep Akella&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 17:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141981#M1906242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-06-19T17:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141982#M1906243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am afraid, you will have to go via the internal table processing way only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Couldn't find a way to select the highlighted records via a SQL statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 17:56:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141982#M1906243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-06-19T17:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141983#M1906244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try the subquery option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write select as below -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select key_field1 key_field2 key_filed3 max(date) max(time) field4 from &amp;lt;table name&amp;gt;&lt;/P&gt;&lt;P&gt;into corresponding fields of table &amp;lt;tablename&amp;gt;&lt;/P&gt;&lt;P&gt;where key_field1 in ( select key_field1&amp;nbsp; where key_field1 in s_key_field1)&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key_field2 in &lt;SPAN style="font-size: 13.3333330154419px;"&gt;( select key_field2&amp;nbsp; where key_field1 in s_key_field2).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assumptions : Only one unique combination of key_field1 and key_field2 will exist as shown by your data sample.&lt;/P&gt;&lt;P&gt;Also i have denoted the input values via select options s_key_field1 and s_key_field2. The aggregation function works with Date and Time type fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2015 03:08:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141983#M1906244</guid>
      <dc:creator>Ankit_Maskara</dc:creator>
      <dc:date>2015-06-21T03:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141984#M1906245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A dummy code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:BEGIN OF ty_vbap,&lt;BR /&gt;&amp;nbsp; vbeln TYPE vbeln,&lt;BR /&gt;&amp;nbsp; posnr TYPE posnr,&lt;BR /&gt;&amp;nbsp; END OF ty_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA&amp;nbsp; lt_vbap TYPE TABLE OF ty_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS s_vbeln FOR vbap-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbeln MAX( posnr ) FROM vbap&lt;BR /&gt;&amp;nbsp; INTO TABLE lt_vbap&lt;BR /&gt;&amp;nbsp; WHERE vbeln IN s_vbeln&lt;BR /&gt;&amp;nbsp; GROUP BY vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BREAK-POINT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I suggest go for Internal table to get Highlighted row instead&amp;nbsp; of aggregation function,.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 08:26:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141984#M1906245</guid>
      <dc:creator>SwadhinGhatuary</dc:creator>
      <dc:date>2015-06-22T08:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141985#M1906246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use a subquery to solve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from table where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key1 = 'value' AND&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key2 = 'value' AND&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date IN (Select MAX (date) from table)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into INTERNAL_TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And sort the resulting IT based on TIME and KEY fields and pick up the latest record based on Date and Time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This approach will reduce the number of records and load on the DB. As far i researched this is a good approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have Timestamp field in the table then it can be done efficiently based on MAX (Timestamp).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepan Swaminathan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 10:08:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141985#M1906246</guid>
      <dc:creator>deepan_v_s</dc:creator>
      <dc:date>2015-06-22T10:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141986#M1906247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked well for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 10:40:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-statement/m-p/11141986#M1906247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-06-30T10:40:38Z</dc:date>
    </item>
  </channel>
</rss>

