title: DB2 - find and compare the lentgh of the value in a table field
body: <p>I am trying to find and compare the length of a field value in table.</p>
  
  <pre><code>Table1
  Id Name 
  1  abcd
  2  xyz
  3  Y
  </code></pre>
  
  <p>I am trying to find the name with length more than 3. The result should have only  record with id 1</p>
  
  <p>I tried <code>LEN</code>. Its not in db2 . i tried <code>length</code> . Its giving the field length ,not the actaul length of the value in that field.</p>
  
  <pre><code>select id,name,LENGTH(name) as namelength  from table1 
  group by id,name having LENGTH(name)&gt;3
  </code></pre>