<?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: Combined select * statement along with select distinct statement? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Combined-select-statement-along-with-select-distinct-statement/m-p/876173#M42981</link>
    <description>&lt;P&gt;You can't really do that (easily) in SQL.&lt;/P&gt;
&lt;P&gt;PROC SORT with NODUPKEY.&lt;/P&gt;
&lt;P&gt;Be aware if you have different values on different rows for the id column, which ones you want in the output data set.&lt;/P&gt;
&lt;P&gt;If they are all the same, you hava duplicate rows, and then you could use DISTINCT in SQL.&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 06:59:02 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2023-05-17T06:59:02Z</dc:date>
    <item>
      <title>Combined select * statement along with select distinct statement?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Combined-select-statement-along-with-select-distinct-statement/m-p/876170#M42980</link>
      <description>PROC SQL; CREATE TABLE T1 AS SELECT * FROM BOOK WHERE PORTFOLIO=''; // the output will show around 1,142,678 data&lt;BR /&gt;PROC SQL; CREATE TABLE T2 AS SELECT DISTINCT ID FROM T1; // the output will show only 68 id- 68 rows.&lt;BR /&gt;&lt;BR /&gt;If I use above code, i will only get the distinct ID in T2. How can I get all the info in T1 by select distinct id? Meaning that i want T2 to show 68 id along with all column.</description>
      <pubDate>Wed, 17 May 2023 06:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Combined-select-statement-along-with-select-distinct-statement/m-p/876170#M42980</guid>
      <dc:creator>tinton</dc:creator>
      <dc:date>2023-05-17T06:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Combined select * statement along with select distinct statement?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Combined-select-statement-along-with-select-distinct-statement/m-p/876173#M42981</link>
      <description>&lt;P&gt;You can't really do that (easily) in SQL.&lt;/P&gt;
&lt;P&gt;PROC SORT with NODUPKEY.&lt;/P&gt;
&lt;P&gt;Be aware if you have different values on different rows for the id column, which ones you want in the output data set.&lt;/P&gt;
&lt;P&gt;If they are all the same, you hava duplicate rows, and then you could use DISTINCT in SQL.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 06:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Combined-select-statement-along-with-select-distinct-statement/m-p/876173#M42981</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-05-17T06:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Combined select * statement along with select distinct statement?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Combined-select-statement-along-with-select-distinct-statement/m-p/876174#M42982</link>
      <description>Thanks for the reply! I've figure it out by using proc sort with nodupkey&lt;BR /&gt;&lt;BR /&gt;DATA NO_DUP_TABLE; SET DUP_DATA; KEY = CATT(ID); RUN;&lt;BR /&gt;&lt;BR /&gt;PROC SORT DATA= NO_DUP_TABLE NODUPKEY DUPOUT=TAB_DUP; BY KEY; RUN;</description>
      <pubDate>Wed, 17 May 2023 07:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Combined-select-statement-along-with-select-distinct-statement/m-p/876174#M42982</guid>
      <dc:creator>tinton</dc:creator>
      <dc:date>2023-05-17T07:05:37Z</dc:date>
    </item>
  </channel>
</rss>

