title: postgresql distinct not working
body: <p>I am using the following code for getting value from the database:</p>
  
  <p>But when i wrote this code (testing as to see where the problem is..) i noticed the query is not fetching the distinct value out from the database:
  Here is the query
    <br><br>  <code>
  select distinct(ca.id)as id, acc.name as accName,pIsu.name as pareentIsu, sIsu.name as subIsu ,
  dv.domain_value as contractType,acc.id as accId,dvct.domain_value as contractstatus<br>
  from contracts_account ca left join business_unit pIsu on ca.parent_isu_fk = pIsu.id<br>
  left join business_unit sIsu on ca.sub_isu_fk = sIsu.id<br>
  left join business_unit acc on ca.account_fk = acc.id<br>
  left join contracts con on con.contracts_account_fk = ca.id<br>
  left join domain_values dv on dv.id = con.contract_type_fk<br>
  left join domain_values dvct on dvct.id = con.contract_status_fk<br>
  where ca.id is not null  and con.contract_type_fk in ( 4466079 ) order by ca.id 
  </code></p>
  
  <p>This query is simply not returning me <strong>'Distinct Id</strong>'<br>
  What am i doing wrong?
  I am using postgres 8.2</p>