title: Why does the Postgres position() function give different results?
body: <p>I am baffled at to why the Postgresql position function gives different results for what seems to be a straightforward test.</p>
  
  <p>Here is query #1:</p>
  
  <pre><code>SELECT count(*)
  FROM 
      dnasample D, ibg_studies ST, subjects S
  WHERE 
      D.studyindex=ST.studyindex
      AND ST.studyabrv='CONGER'
      AND D.subjectidkey=S.id
      AND D.projectindex IS NULL
      AND POSITION('Previous subjectid:' in D.comment) IS NULL
  </code></pre>
  
  <p>which returns a result of 246.</p>
  
  <p>Then here is query #2:</p>
  
  <pre><code>SELECT count(*)
  FROM 
      dnasample D, ibg_studies ST, subjects S
  WHERE 
      D.studyindex=ST.studyindex
      AND ST.studyabrv='CONGER'
      AND D.subjectidkey=S.id
      AND D.projectindex IS NULL
      AND POSITION('Previous subjectid:' in D.comment)=0 
  </code></pre>
  
  <p>I do not see why these return such different results?</p>
  
  <p>I've tried reading the Postgres documentation to clarify the difference between zero and the null string, but not much luck there yet...</p>
  
  <p>Thanks in advance, 
  --Rick</p>