<?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 proc sql  query 1 vs query 2 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-query-1-vs-query-2/m-p/38452#M9856</link>
    <description>HI:&lt;BR /&gt;
I am wandering why would the first take a lot longer then the second query in proc sql , the difference is noted in NOTE DIFFERENCE comment.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
:&lt;BR /&gt;
/*Query 1  */&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
select a.id, &lt;BR /&gt;
        b.name &lt;BR /&gt;
  &lt;BR /&gt;
from transactions as a , &lt;BR /&gt;
        person as b&lt;BR /&gt;
where &lt;BR /&gt;
a.id = b.id&lt;BR /&gt;
and&lt;BR /&gt;
b.seq = (&lt;BR /&gt;
		select max(sub.seq)&lt;BR /&gt;
		from person as sub&lt;BR /&gt;
		where b.id = sub.id  /*NOTE DIFFERENCE*/&lt;BR /&gt;
)&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/*Query 2  */&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
select a.id, &lt;BR /&gt;
       b.name &lt;BR /&gt;
  &lt;BR /&gt;
from transactions as a ,&lt;BR /&gt;
       person as b&lt;BR /&gt;
where &lt;BR /&gt;
a.id = b.id&lt;BR /&gt;
and&lt;BR /&gt;
b.seq = (&lt;BR /&gt;
		select max(sub.seq)&lt;BR /&gt;
		from person as sub&lt;BR /&gt;
		where a.id = sub.id  /*NOTE DIFFERENCE*/&lt;BR /&gt;
&lt;BR /&gt;
)&lt;BR /&gt;
quit;</description>
    <pubDate>Fri, 25 Mar 2011 15:58:54 GMT</pubDate>
    <dc:creator>jplarios</dc:creator>
    <dc:date>2011-03-25T15:58:54Z</dc:date>
    <item>
      <title>proc sql  query 1 vs query 2</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-query-1-vs-query-2/m-p/38452#M9856</link>
      <description>HI:&lt;BR /&gt;
I am wandering why would the first take a lot longer then the second query in proc sql , the difference is noted in NOTE DIFFERENCE comment.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
:&lt;BR /&gt;
/*Query 1  */&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
select a.id, &lt;BR /&gt;
        b.name &lt;BR /&gt;
  &lt;BR /&gt;
from transactions as a , &lt;BR /&gt;
        person as b&lt;BR /&gt;
where &lt;BR /&gt;
a.id = b.id&lt;BR /&gt;
and&lt;BR /&gt;
b.seq = (&lt;BR /&gt;
		select max(sub.seq)&lt;BR /&gt;
		from person as sub&lt;BR /&gt;
		where b.id = sub.id  /*NOTE DIFFERENCE*/&lt;BR /&gt;
)&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/*Query 2  */&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
select a.id, &lt;BR /&gt;
       b.name &lt;BR /&gt;
  &lt;BR /&gt;
from transactions as a ,&lt;BR /&gt;
       person as b&lt;BR /&gt;
where &lt;BR /&gt;
a.id = b.id&lt;BR /&gt;
and&lt;BR /&gt;
b.seq = (&lt;BR /&gt;
		select max(sub.seq)&lt;BR /&gt;
		from person as sub&lt;BR /&gt;
		where a.id = sub.id  /*NOTE DIFFERENCE*/&lt;BR /&gt;
&lt;BR /&gt;
)&lt;BR /&gt;
quit;</description>
      <pubDate>Fri, 25 Mar 2011 15:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-query-1-vs-query-2/m-p/38452#M9856</guid>
      <dc:creator>jplarios</dc:creator>
      <dc:date>2011-03-25T15:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql  query 1 vs query 2</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-query-1-vs-query-2/m-p/38453#M9857</link>
      <description>There are a lot of POSSIBLE reasons that are data dependent.  Without knowing the data, we are shooting in the dark.  Possible reasons include:&lt;BR /&gt;
-- size of data set a vs b.&lt;BR /&gt;
-- indexing on a vs b.&lt;BR /&gt;
-- location of a vs b (e.g. SAS dataset or Oracle database).&lt;BR /&gt;
-- data set type (view vs dataset)&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
      <pubDate>Fri, 25 Mar 2011 17:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-query-1-vs-query-2/m-p/38453#M9857</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-03-25T17:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql  query 1 vs query 2</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-query-1-vs-query-2/m-p/38454#M9858</link>
      <description>As a minor addition to Docs comment on location: network drive vs local if your network runs like mine.</description>
      <pubDate>Mon, 28 Mar 2011 21:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-query-1-vs-query-2/m-p/38454#M9858</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2011-03-28T21:02:57Z</dc:date>
    </item>
  </channel>
</rss>

