<?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: I have used distinct statement but still getting same numbers. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/I-have-used-distinct-statement-but-still-getting-same-numbers/m-p/820910#M34870</link>
    <description>&lt;P&gt;DISTINCT works on the combination of ALL variables in the query, the variables from A and the variables from B.&amp;nbsp;Whatever is in a.* is not distinct, even though the phone numbers are the same. That's why phone numbers can appear more than once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want a list of distinct phone numbers use table B and only the variable dcPhoneNumber. However, I suspect that's not what you want either, and so&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391779"&gt;@Sandeep77&lt;/a&gt;&amp;nbsp;it ALWAYS helps (that's ALWAYS) if we know the final result you want, and we don't know that, you haven't told us.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jun 2022 13:49:10 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-06-29T13:49:10Z</dc:date>
    <item>
      <title>I have used distinct statement but still getting same numbers.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-have-used-distinct-statement-but-still-getting-same-numbers/m-p/820909#M34869</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;I have been trying to find the distinct dcphonenumbers and I have used select distinct but in the output data, it gives me duplicate dcphonenumbers also. Can you please check and suggest what's the mistake in the code?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table Dialled_numbers as
select distinct
a.*,
b.dcPhoneNumber
from work.confirmed_email as a
inner join DIALFILE.tDiallerCalls as b on a.account_number=b.dcaccountnumber;
quit;

LOG
29         proc sql;
30         create table Dialled_numbers as
31         select distinct
32         a.*,
33         b.dcPhoneNumber
34         
35         from work.confirmed_email as a
36         inner join DIALFILE.tDiallerCalls as b on a.account_number=b.dcaccountnumber
37         ;
NOTE: Compressing data set WORK.DIALLED_NUMBERS decreased size by 90.69 percent. 
      Compressed is 1679 pages; un-compressed would require 18034 pages.
NOTE: Table WORK.DIALLED_NUMBERS created, with 721344 rows and 14 columns.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 13:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-have-used-distinct-statement-but-still-getting-same-numbers/m-p/820909#M34869</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2022-06-29T13:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: I have used distinct statement but still getting same numbers.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-have-used-distinct-statement-but-still-getting-same-numbers/m-p/820910#M34870</link>
      <description>&lt;P&gt;DISTINCT works on the combination of ALL variables in the query, the variables from A and the variables from B.&amp;nbsp;Whatever is in a.* is not distinct, even though the phone numbers are the same. That's why phone numbers can appear more than once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want a list of distinct phone numbers use table B and only the variable dcPhoneNumber. However, I suspect that's not what you want either, and so&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391779"&gt;@Sandeep77&lt;/a&gt;&amp;nbsp;it ALWAYS helps (that's ALWAYS) if we know the final result you want, and we don't know that, you haven't told us.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 13:49:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-have-used-distinct-statement-but-still-getting-same-numbers/m-p/820910#M34870</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-29T13:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: I have used distinct statement but still getting same numbers.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-have-used-distinct-statement-but-still-getting-same-numbers/m-p/820926#M34872</link>
      <description>I just wanted the unique counts of the phone numbers. So I removed a.*, and ran the query with select distinct b.dcPhoneNumber and it worked.&lt;BR /&gt;&lt;BR /&gt;Thanks again!</description>
      <pubDate>Wed, 29 Jun 2022 14:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-have-used-distinct-statement-but-still-getting-same-numbers/m-p/820926#M34872</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2022-06-29T14:20:43Z</dc:date>
    </item>
  </channel>
</rss>

