title: Creating a search query with wildcard in SQL2
body: <p>I've got a request about a search, using wildcard.</p>
  
  <p>I created the following query</p>
  
  <pre><code>SELECT * FROM [nt:base] AS p WHERE
  ISDESCENDANTNODE(p, [/home/users/ldap/2]) AND
  p.[sling:resourceType] = 'cq/security/components/profile' AND 
  Contains (p.memberOf, 'SUG-pilot-anna')
  </code></pre>
  
  <p>and it works as expected. The task of this query is to look for users, who are member of a particular ldap group.</p>
  
  <p>Because there is a lot of work to search for every single group, like </p>
  
  <pre><code>SUG-pilot-anna
  SUG-pilot-berta
  SUG-pilot-ceta
  </code></pre>
  
  <p>, it would be easier and more efficient to use the wildcard. According serveral documantations, the <code>LIKE</code> operator is supported by SQL2. </p>
  
  <p>My question is: how does looks the query with wildcard?</p>
  
  <p>Thanks for your help/idears.</p>