title: Using [like] like in clause in SQL?
body: <pre><code>USE tempdb
  
  CREATE TABLE A
  (
       id INT,
       a_desc VARCHAR(100)
  )
  
  INSERT INTO A 
  VALUES (1, 'vish'),(2,'hp'),(3,'IBM'),(4,'google')
  
  SELECT * FROM A
  
  CREATE TABLE B
  (
       id INT,
       b_desc VARCHAR(100)
  )
  
  INSERT INTO B 
  VALUES (1, 'IBM[SR4040][SR3939]'),(2,'hp[GR3939]')
  
  SELECT * FROM B
  
  SELECT * 
  FROM A 
  WHERE a_desc LIKE (SELECT b_desc FROM B) -- IN with LIKE problem here
  </code></pre>
  
  <p>all the time the ending string is not same in table B so I can't use trim approach to
  delete certain character and match in In clause.</p>
  
  <p>-- above throwing error subquery returned more than 1 value</p>
  
  <p>-- I've thousand rows in both tables just for example purpose I've created this example</p>
  
  <pre><code>--excepted output 
  --IBM
  --hp 
  </code></pre>
  
  <p>--from A table</p>