<?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: How to use where clause with IN statement for two differnt columns in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283120#M8082</link>
    <description>&lt;PRE&gt;

Patrick,

Agree. But it is more readable, isn't it ?


&lt;/PRE&gt;</description>
    <pubDate>Sat, 09 Jul 2016 06:18:46 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-07-09T06:18:46Z</dc:date>
    <item>
      <title>How to use where clause with IN statement for two differnt columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/282912#M8068</link>
      <description>&lt;P&gt;I am using a statement to using where clause but it is returing error. Below is the statment i am using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select * from (select&lt;BR /&gt;a.QST_ID as qID,&lt;BR /&gt;a.QST_VER_NO as ver_no,&lt;BR /&gt;a.MI_OPTNS_ID as index1,&lt;BR /&gt;b.MI_OPTNS_TXT as value&lt;BR /&gt;from QST_MI_OPTNS_LINK_TBL a INNER JOIN MI_OPTNS_LIST_TBL b on&lt;BR /&gt;a.MI_OPTNS_ID = b.ID)&lt;BR /&gt;where (qID, ver_no) in ( (2973,3), (2983,4))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am receiving syntax error near where statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 11:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/282912#M8068</guid>
      <dc:creator>elan2799</dc:creator>
      <dc:date>2016-07-08T11:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with IN statement for two differnt columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/282924#M8070</link>
      <description>&lt;P&gt;You can't specify the where clause like that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You meed to do so,etching like the following. This assumes that you don't need specific combinations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where qid in (value list) and/or ver_no in (value list).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 12:13:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/282924#M8070</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-08T12:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with IN statement for two differnt columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/282925#M8071</link>
      <description>&lt;P&gt;You can't specify the where clause like that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You meed to do so,etching like the following. This assumes that you don't need specific combinations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where qid in (value list) and/or ver_no in (value list).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 12:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/282925#M8071</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-08T12:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with IN statement for two differnt columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/282962#M8072</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Each qid column has 1 to 7 version ids. I want to extract the Qid 2973 for&lt;BR /&gt;version 3 &amp;amp; 2983 for version 4 alone but this 2973 ,2983 matches multiple&lt;BR /&gt;version. If u want I can send sample datasets.&lt;BR /&gt;&lt;BR /&gt;CHEERS,&lt;BR /&gt;ELA</description>
      <pubDate>Fri, 08 Jul 2016 13:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/282962#M8072</guid>
      <dc:creator>elan2799</dc:creator>
      <dc:date>2016-07-08T13:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with IN statement for two differnt columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283102#M8075</link>
      <description>&lt;P&gt;I believe below is the valid SQL logic for what you're after&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  select
    a.QST_ID as qID,
    a.QST_VER_NO as ver_no,
    a.MI_OPTNS_ID as index1,
    b.MI_OPTNS_TXT as value
  from 
    QST_MI_OPTNS_LINK_TBL a 
    INNER JOIN 
    MI_OPTNS_LIST_TBL b 
    on
      a.MI_OPTNS_ID = b.ID
      and 
        (
          a.QST_ID=2973 and a.QST_VER_NO=3
          or
          a.QST_ID=2983 and a.QST_VER_NO=4
        )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jul 2016 03:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283102#M8075</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-07-09T03:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with IN statement for two differnt columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283109#M8079</link>
      <description>&lt;PRE&gt;

where (qID, ver_no) in ( (2973,3), (2983,4))

-----&amp;gt;&amp;gt;

where  catx(' ',qID, ver_no) in ( '2973 3', '2983 4')


&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jul 2016 04:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283109#M8079</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-09T04:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with IN statement for two differnt columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283112#M8081</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Concatenation works of course but it's also certainly the least performant option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2016 04:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283112#M8081</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-07-09T04:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with IN statement for two differnt columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283120#M8082</link>
      <description>&lt;PRE&gt;

Patrick,

Agree. But it is more readable, isn't it ?


&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jul 2016 06:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-use-where-clause-with-IN-statement-for-two-differnt/m-p/283120#M8082</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-09T06:18:46Z</dc:date>
    </item>
  </channel>
</rss>

