title: join two tables data in third table
body: <p>I have two tables ,one sensor_info and other one is bays_info.here are the tables</p>
  
  <pre><code>id  Sensor_Name   stn_id    value  Station_id
  1   Sensor1          0       4.4      1
  2   Sensor2          0       2.1      1
  3   Sensor3          0       3.2      1
  4   Sensor4          1       4.5      1 
  </code></pre>
  
  <p>Bays_info</p>
  
  <pre><code>gate_id     bay_name    bay_status    Station_id  
  
  GATE1       B_gate1         1            1
  GATE2       B_gate2        -999          1
  GATE3       B_gate2         1            1
  GATE4       B_gate2        -999          1
  GATE5       B_gate2          1           1
  </code></pre>
  
  <p>Friends I need to show all "sensors value" for each gate, like below (here station id is common col)</p>
  
  <pre><code>gate_id     bay_name    bay_status    Station_id  Sensor1  Sensor2 sensor3 sensor4
  
  GATE1       B_gate1         1            1         4.4       2.1    3.2      4.5
  GATE2       B_gate2        -999          1         4.4       2.1    3.2      4.5
  GATE3       B_gate2         1            1         4.4       2.1    3.2      4.5
  GATE4       B_gate2        -999          1         4.4       2.1    3.2      4.5
  GATE5       B_gate2          1           1         4.4       2.1    3.2      4.5
  </code></pre>
  
  <p>So I need to show value from sensor table for each station and also need to show sensor names as header.Please help me for MySQL query.</p>