title: Is there any way to fetch data in json format from PostgreSQL table which has different field not the json data type field?
body: <p>I have a table in PostgreSQL which has field like id,name,city,mob
  etc. i got that in PostgreSQL there is json data type in which we can
  store the data in json format but I don't want to use json data type.</p>
  
  <p>I want to fetch these table field (id,name,city,mob) which are normal fields not json data type field that I want in json format</p>
  
  <p>I want that suppose mytable is a table which has id,name,city,mob,dob as field and<br>
  now i want to execute query like:</p>
  
  <pre><code>select name,city from mytable where id=5;
  </code></pre>
  
  <p>This query should return output like <code>{"name":"xyz","city":"abc"}</code></p>
  
  <p>so how can i do that and what should be the query for that?</p>