title: PostgreSQL query using subquery is giving exception
body: <p>This is my postgres query (using postgres 9.0 version) for selecting the latest records of each url. My dns_lookup_table consists of different values for each url at different times.</p>
  
  <p>url1,url2,url3 are 'text' type, update_time is 'timestamp with timezone' and dns_time is 'numeric' type.</p>
  
  <pre><code>select url,
         dns_time,
         update_Time 
  from dns_lookup_table 
  where url in('url1', 'url2','url3') 
   and  update_time = max(select to_char(update_time,'YYYY-MM-DD HH24:MI'));
  </code></pre>
  
  <p>Please help me I am getting syntax error at "select"</p>