<?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 - different results inline x where in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81301#M8961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure what's happening there in inline query.&lt;/P&gt;&lt;P&gt;I have added alfa2 in select statement and dropped the same in a data set option.&lt;/P&gt;&lt;P&gt;It seems this returns what's needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table arq_join2(drop=alfa2) as&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;alfa1,&lt;/P&gt;&lt;P&gt;alfa2,&lt;/P&gt;&lt;P&gt;count(*) as qte_alfa1,&lt;/P&gt;&lt;P&gt;qte_alfabeta2&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arq1_,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select alfa2,beta2,count(*) as qte_alfabeta2 from arq2_ group by 1,2)&lt;/P&gt;&lt;P&gt;where alfa1=alfa2&lt;/P&gt;&lt;P&gt;group by 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2012 14:46:34 GMT</pubDate>
    <dc:creator>Alpay</dc:creator>
    <dc:date>2012-06-13T14:46:34Z</dc:date>
    <item>
      <title>SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81296#M8956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello everybody !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody explain why&amp;nbsp;I have two different results ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data arq1_;&lt;BR /&gt;input alfa1 $ ind1;&lt;BR /&gt;datalines;&lt;BR /&gt;a 1&lt;BR /&gt;a 2&lt;BR /&gt;b 1&lt;BR /&gt;b 2&lt;BR /&gt;b 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data arq2_;&lt;BR /&gt;input alfa2 $ beta2 $ ind2;&lt;BR /&gt;datalines;&lt;BR /&gt;a x 1&lt;BR /&gt;a y 1&lt;BR /&gt;a y 2&lt;BR /&gt;a z 1&lt;BR /&gt;a z 2&lt;BR /&gt;c x 1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/&lt;STRONG&gt;###################### FIRST METHOD #########################&lt;/STRONG&gt;/&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created the table "inline" after that I just did the join with where statement ("arq_join").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create table inline as&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select alfa2,beta2,count(&lt;STRONG&gt;) as qte_alfabeta2&amp;lt;br&amp;gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; from arq2_ group by 1,2;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;quit;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;nbsp;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;nbsp;proc sql;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;create table arq_join as&amp;lt;br&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;alfa1,&amp;lt;br&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(&lt;/STRONG&gt;) as qte_alfa1,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;qte_alfabeta2&lt;BR /&gt;from&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arq1_,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inline&lt;BR /&gt;&amp;nbsp;where alfa1=alfa2&lt;BR /&gt;&amp;nbsp;group by 1;&lt;BR /&gt;&amp;nbsp;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/&lt;STRONG&gt;######################&amp;nbsp;SECOND METHOD&amp;nbsp;(USING INLINE)&amp;nbsp;#########################&lt;/STRONG&gt;/&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I just put the query in the inline view, but a couldn't understand why in this case I have different results.&lt;BR /&gt;proc sql;&lt;BR /&gt;create table arq_join2 as&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a.alfa1,count(&lt;STRONG&gt;)as qte_alfa1,qte_alfabeta2&amp;lt;br&amp;gt;from&amp;nbsp; arq1_ as a,&amp;lt;br&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select b.alfa2,b.beta2,count(&lt;/STRONG&gt;) as qte_alfabeta2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;from arq2_ as b group by 1,2)&lt;BR /&gt;where alfa1=alfa2&lt;BR /&gt;group by 1;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it's the same query, the second method is just with inline view, isn't ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why the second method generates different results ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tk's in advanced&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: rgb(0, 0, 255); font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="color: rgb(0, 0, 255); font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="color: rgb(0, 0, 255); font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;span style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"&amp;gt;&amp;lt;span style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"&amp;gt;&amp;lt;span style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="color: rgb(0, 0, 128); font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;SPAN style="font-family: Courier New; font-size: 12pt;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="mcePaste" data-mce-bogus="1" id="_mcePaste" style="left: -10000px; top: 131px; width: 1px; height: 1px; overflow: hidden; position: absolute;"&gt;&lt;P&gt;﻿﻿&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 19:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81296#M8956</guid>
      <dc:creator>Abud</dc:creator>
      <dc:date>2012-06-12T19:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81297#M8957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gustavo, your question is all garbled, very difficult to read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 20:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81297#M8957</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-06-12T20:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81298#M8958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pg!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I think it's ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data arq1_;&lt;BR /&gt;input alfa1 $ ind1;&lt;BR /&gt;datalines;&lt;BR /&gt;a 1&lt;BR /&gt;a 2&lt;BR /&gt;b 1&lt;BR /&gt;b 2&lt;BR /&gt;b 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data arq2_;&lt;BR /&gt;input alfa2 $ beta2 $ ind2;&lt;BR /&gt;datalines;&lt;BR /&gt;a x 1&lt;BR /&gt;a y 1&lt;BR /&gt;a y 2&lt;BR /&gt;a z 1&lt;BR /&gt;a z 2&lt;BR /&gt;c x 1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;/&lt;STRONG&gt;###################### FIRST METHOD #########################&lt;/STRONG&gt;/&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;I created the table "inline" after that I just did the join with where statement ("arq_join").&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table inline as select&lt;BR /&gt;alfa2,beta2,count(*) as qte_alfabeta2&lt;BR /&gt;from arq2_ group by 1,2;&lt;BR /&gt;quit;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table arq_join as&lt;BR /&gt;select&lt;BR /&gt;alfa1,&lt;BR /&gt;count(*) as qte_alfa1,&lt;BR /&gt;qte_alfabeta2&lt;BR /&gt;from&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arq1_,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inline&lt;BR /&gt;where alfa1=alfa2&lt;BR /&gt;group by 1;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;STRONG&gt;###################### SECOND METHOD (USING INLINE) #########################*&lt;/STRONG&gt;/&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table arq_join2 as&lt;BR /&gt;select&lt;BR /&gt;alfa1,&lt;BR /&gt;count(*) as qte_alfa1,&lt;BR /&gt;qte_alfabeta2&lt;BR /&gt;from&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arq1_,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select alfa2,beta2,count(*) as qte_alfabeta2 from arq2_ group by 1,2)&lt;BR /&gt;where alfa1=alfa2&lt;BR /&gt;group by 1&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;I think it's the same query, the second method is just with inline view, isn't ?&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Why the second method generates different results ?&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;tk's in advanced&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;title 'arq1_';&lt;BR /&gt;select * from arq1_;&lt;/P&gt;&lt;P&gt;title 'arq2_';&lt;BR /&gt;select * from arq2_;&lt;/P&gt;&lt;P&gt;title 'inline';&lt;BR /&gt;select * from inline;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;title 'arq_join';&lt;BR /&gt;select * from arq_join;&lt;/P&gt;&lt;P&gt;title 'arq_join2';&lt;BR /&gt;select * from arq_join2;&lt;/P&gt;&lt;P&gt;title;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 20:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81298#M8958</guid>
      <dc:creator>Abud</dc:creator>
      <dc:date>2012-06-12T20:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81299#M8959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still scratching my head over this one. I don't understand why there in no remerging in the second version. I hope someone can explain this &lt;EM&gt;feature&lt;/EM&gt; :smileyconfused: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 23:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81299#M8959</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-06-12T23:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81300#M8960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know what you mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tk's PG&amp;nbsp; &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; !! If you find something please send me a msg...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 01:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81300#M8960</guid>
      <dc:creator>Abud</dc:creator>
      <dc:date>2012-06-13T01:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81301#M8961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure what's happening there in inline query.&lt;/P&gt;&lt;P&gt;I have added alfa2 in select statement and dropped the same in a data set option.&lt;/P&gt;&lt;P&gt;It seems this returns what's needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table arq_join2(drop=alfa2) as&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;alfa1,&lt;/P&gt;&lt;P&gt;alfa2,&lt;/P&gt;&lt;P&gt;count(*) as qte_alfa1,&lt;/P&gt;&lt;P&gt;qte_alfabeta2&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arq1_,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select alfa2,beta2,count(*) as qte_alfabeta2 from arq2_ group by 1,2)&lt;/P&gt;&lt;P&gt;where alfa1=alfa2&lt;/P&gt;&lt;P&gt;group by 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 14:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81301#M8961</guid>
      <dc:creator>Alpay</dc:creator>
      <dc:date>2012-06-13T14:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81302#M8962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Ttk's for the tip!!&lt;/P&gt;&lt;P&gt;It's working but, I think the big question is, why the second doesn't work like the first one ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 15:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81302#M8962</guid>
      <dc:creator>Abud</dc:creator>
      <dc:date>2012-06-13T15:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81303#M8963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are still lacking any explanation, so I submitted a streamlined version of the problem to SAS Tech Report. I will pass along what I learn.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;PGStats wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I'm still scratching my head over this one. I don't understand why there in no remerging in the second version. I hope someone can explain this &lt;EM&gt;feature&lt;/EM&gt; &lt;SPAN __jive_emoticon_name="confused"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;PG&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 01:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81303#M8963</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-06-27T01:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81304#M8964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I meant of course to say Tech Support (not Report).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TS has responded. They say this is a bug and that it will be fixed in Version 9.4. A SAS Note will be posted once analysis of the bug has been completed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From my own testing I perceive that a named view used in place of the inline view does not avoid the problem, but using a table to hold the intermediate result is a workaround.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;Howard Schreier wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;We are still lacking any explanation, so I submitted a streamlined version of the problem to SAS Tech Report. I will pass along what I learn.&lt;/P&gt;
&lt;BLOCKQUOTE class="jive-quote"&gt;
&lt;P&gt;PGStats wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I'm still scratching my head over this one. I don't understand why there in no remerging in the second version. I hope someone can explain this &lt;EM&gt;feature&lt;/EM&gt; &lt;SPAN __jive_emoticon_name="confused"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;PG&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2012 14:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81304#M8964</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-07-19T14:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81305#M8965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tech support says that "the problem can occur when the query references a view that has an aliased aggregate on its topmost SELECT list and that alias is references on the SELECT list of the latest query but does not appear on the group by clause.&amp;nbsp; It has been fixed and is currently slated to be released with SAS 9.4.".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2012 21:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81305#M8965</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-08-04T21:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81306#M8966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anytime you want to do a group by you need to do a distinct also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;puzzled me for years.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2012 22:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81306#M8966</guid>
      <dc:creator>econ</dc:creator>
      <dc:date>2012-08-04T22:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - different results inline x where</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81307#M8967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's not true. Look at the SQL solutions proposed on this forum, most uses of the GROUP BY clause occur without a DISTINCT constraint. For example, the query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT a, b, SUM(x) as sumX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM have&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GROUP BY a, b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will only return distinct combinations of &lt;STRONG&gt;a&lt;/STRONG&gt; an &lt;STRONG&gt;b&lt;/STRONG&gt;. Adding a DISTINCT clause will yield the same result but less efficiently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2012 23:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SQL-different-results-inline-x-where/m-p/81307#M8967</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-04T23:30:18Z</dc:date>
    </item>
  </channel>
</rss>

