title: How to differentiate between same field names of two tables in a select query?
body: <p>I have more than two tables in my database and all of them contains same field names like</p>
  
  <pre><code>table A           table B       table C
  field1            field1        field1
  field2            field2        field2
  field3            field3        field3
  .                 .             .
  .                 .             .
  .                 .             .
  .                 .             .
  </code></pre>
  
  <p>I have to write a <code>SELECT</code> query which gets almost all same fields from these 3 tables. I am using something like this :</p>
  
  <pre><code>select a.field1,a.field2,a.field3,b.field1,b.field2,b.field3,c.field1,c.field2,c.field3 from table A as a, table B as b,table C as c where so and so.
  </code></pre>
  
  <p>but when I print <code>field1</code>'s value it gives me the last table values.</p>
  
  <p>How can I get all the values of three tables with the same field names? do I have to write individual query for every table OR there is any ways of fetching them all in a single query?</p>