title: mysql fetch data from multiple table with one to many foreign key reference
body: <p>Hi i have to write a mysql query i will explain the query how i want to work.</p>
  <p>I have two table</p>
  <p>A</p>
  <pre><code>CREATE TABLE IF NOT EXISTS `A` (
    `field1` int(10) NOT NULL AUTO_INCREMENT,
    `field2` int(10) NOT NULL,
    `field3` int(10) NOT NULL,
    `field4` varchar(255) DEFAULT NULL,
    `fields5` int(10) NOT NULL,
    `field6` varchar(255) NOT NULL,
    `field7` varchar(255) NOT NULL,
    `field8` int(10) NOT NULL,
    `field9` tinyint(1) NOT NULL COMMENT '1=for enabled resource 0= for
  disabled resource',
    PRIMARY KEY (`field1`);
  
  </code></pre>
  <p>table B</p>
  <pre><code>CREATE TABLE IF NOT EXISTS `estimate_resource_mth` (
    `field1` int(10) NOT NULL AUTO_INCREMENT,
    `field2` int(10) NOT NULL,
    `field3` int(10) NOT NULL,
    `field4` int(10) NOT NULL,
    PRIMARY KEY (`field1`) ;
  </code></pre>
  <p>There is one to many reference from <code>tableA</code> to <code>tableB</code> that is <code>A.field1</code> multiple reference to <code>B.table2</code>. Now i will explain what i need to get, i have an id which fetch the data from table <code>A</code> using where condition i need to return this list with the sum of <code>filed4</code> in tableB(field2 in tableB reference to tableA and it may be a multple row one to many relatio ). How could i got a this data in a single query.</p>