<?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: NOTE message in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908491#M358509</link>
    <description>&lt;P&gt;Always show your whole log, copy/paste it into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Always.&amp;nbsp;&lt;STRONG&gt;Always. &lt;U&gt;ALWAYS&lt;/U&gt;.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The NOTE is caused by using a variable in the SELECT which is neither part of the GROUP BY clause nor the result of a SQL summary function. In most SQL variants (as used in databases), this would cause an ERROR, but SAS allows it.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Dec 2023 17:06:49 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-12-16T17:06:49Z</dc:date>
    <item>
      <title>NOTE message: The query requires remerging summary statistics back with the original data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908469#M358495</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a NOTE message in my log :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The query requires remerging summary statistics back with the original data.&lt;/P&gt;
&lt;P&gt;Do you know please why we can have it in proc sql ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could I continue to run my program with this message (the result is OK).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2023 20:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908469#M358495</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-12-17T20:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908470#M358496</link>
      <description>&lt;P&gt;Please do not show us partial logs. From now on (including this thread), please do show us the ENTIRE log for this PROC that you have a question about, that's every single line in the log for this PROC.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 11:08:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908470#M358496</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-16T11:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908471#M358497</link>
      <description>Dont want that note Use (Group by) instead of (having) keyword</description>
      <pubDate>Sat, 16 Dec 2023 11:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908471#M358497</guid>
      <dc:creator>112211</dc:creator>
      <dc:date>2023-12-16T11:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908472#M358498</link>
      <description>Thank you, I use group by, actually.</description>
      <pubDate>Sat, 16 Dec 2023 11:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908472#M358498</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-12-16T11:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908491#M358509</link>
      <description>&lt;P&gt;Always show your whole log, copy/paste it into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Always.&amp;nbsp;&lt;STRONG&gt;Always. &lt;U&gt;ALWAYS&lt;/U&gt;.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The NOTE is caused by using a variable in the SELECT which is neither part of the GROUP BY clause nor the result of a SQL summary function. In most SQL variants (as used in databases), this would cause an ERROR, but SAS allows it.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 17:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908491#M358509</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-16T17:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908495#M358510</link>
      <description>&lt;P&gt;If you select detail variables that are neither grouping variables nor summary statistics then SAS will remerge the summary statistics onto all of the observations in the group.&lt;/P&gt;
&lt;PRE&gt;1    proc sql ;
2    create table want as
3      select *,mean(age) as mean_age_by_sex
4      from sashelp.class
5      group by sex
6      order by name
7    ;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.WANT created, with 19 rows and 6 columns.

8    quit;
&lt;/PRE&gt;
&lt;P&gt;A lot of SQL implementations will not remerge summary statistics for you.&lt;/P&gt;
&lt;P&gt;I assume that is why SAS issues the note.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need to change anything unless that is NOT what you intended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you want to do the same thing in some other implementation of SQL you might need to make your query more complicated.&lt;/P&gt;
&lt;PRE&gt;9    proc sql ;
10   create table want as
11     select a.*,b.mean_age_by_sex
12     from sashelp.class a
13     inner join
14      (select sex,mean(age) as mean_age_by_sex
15       from sashelp.class group by sex) b
16     on a.sex=b.sex
17     order by name
18   ;
NOTE: Table WORK.WANT created, with 19 rows and 6 columns.

19   quit;
&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Dec 2023 17:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908495#M358510</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-16T17:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908497#M358511</link>
      <description>Thank you, Tom !</description>
      <pubDate>Sat, 16 Dec 2023 18:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-message-The-query-requires-remerging-summary-statistics/m-p/908497#M358511</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-12-16T18:15:06Z</dc:date>
    </item>
  </channel>
</rss>

