<?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 select Where in list of strings in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/SQL-select-Where-in-list-of-strings/m-p/2087221#M12427</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try This:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;T1:&lt;/P&gt;
&lt;P&gt;Load * inline (&lt;SPAN&gt;country_code, US);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Load * from table.qvd where exists(Country_code);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;drop t1&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2023 13:39:08 GMT</pubDate>
    <dc:creator>NiTo</dc:creator>
    <dc:date>2023-06-23T13:39:08Z</dc:date>
    <item>
      <title>SQL select Where in list of strings</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/SQL-select-Where-in-list-of-strings/m-p/2087120#M12426</link>
      <description>&lt;P&gt;I am trying to query a table where specific country codes exist in field 'country_code' from a Redshift db. My solution is shared below, but I feel like it could have better performance:&lt;/P&gt;
&lt;PRE&gt;[tbl1]: &lt;BR /&gt;LOAD &lt;BR /&gt;distinct country_code as distinct_country_code // e.g., ='US'&lt;BR /&gt;FROM source;&lt;BR /&gt;&lt;BR /&gt;[temp]:&lt;BR /&gt;Load&lt;BR /&gt;Concat(distinct chr(39) &amp;amp; distinct_country_code &amp;amp; chr(39), ',') as distinct_country_code_str // ='US', 'FR'&lt;BR /&gt;Resident tbl1;&lt;BR /&gt;&lt;BR /&gt;LET vCountry_List = Peek('distinct_country_code', 0, 'temp');&lt;BR /&gt;drop Table temp;&lt;BR /&gt;&lt;BR /&gt;[tbl2]:&lt;BR /&gt;LOAD *;&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM db.collection&lt;BR /&gt;WHERE country_code in ($(vCountry_List)); // Prints as: WHERE country_code in ('US', 'FR');&lt;/PRE&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 09:23:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/SQL-select-Where-in-list-of-strings/m-p/2087120#M12426</guid>
      <dc:creator>prayner</dc:creator>
      <dc:date>2023-06-23T09:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select Where in list of strings</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/SQL-select-Where-in-list-of-strings/m-p/2087221#M12427</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try This:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;T1:&lt;/P&gt;
&lt;P&gt;Load * inline (&lt;SPAN&gt;country_code, US);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Load * from table.qvd where exists(Country_code);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;drop t1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 13:39:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/SQL-select-Where-in-list-of-strings/m-p/2087221#M12427</guid>
      <dc:creator>NiTo</dc:creator>
      <dc:date>2023-06-23T13:39:08Z</dc:date>
    </item>
  </channel>
</rss>

