SELECT FROM SELECT date_format Date_time Y- m- AS dt cons sigma FROM k

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
SELECT * FROM (
(SELECT date_format(Date_time,'%Y-%m-%d %H:%i') AS dt,cons,sigma
FROM khms.dasibi
WHERE date_time>='2014-01-01'and date_time <='2014-12-31') AS dasibi
LEFT JOIN
(SELECT date_format(Date_time,'%Y-%m-%d %H:%i') AS dt, wind_dir, out_hum, temp_out
FROM khms.davis
WHERE date_time>='2014-01-01'and date_time <='2014-12-31') AS dav
USING (dt)
)
WHERE wind_dir='W' OR wind_dir='NW' OR wind_dir='SW' OR wind_dir='S' OR wind_dir='SSW' OR wind_dir='NNW' limit 400000