 |
|
|
 |
 |
|
ช่วยดูหน่อยครับ
|
 |
 |
 |
 |
Date :
2010-05-17 14:46:12 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
select max(ฟิวที่ต้องการหาค่ามากสุด) as ตั้งชื่อฟิว form ชื่อตาราง where ฟิววัน = 'วันทีต้องการ'
|
 |
 |
 |
 |
Date :
2010-05-17 15:02:13 |
By :
viruscom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
select max(columnname) from tb where date_format(columname3,'%Y%m')='200901' group by date_format(columname2,'%d')
|
 |
 |
 |
 |
Date :
2010-05-17 15:03:06 |
By :
2123 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมลอง
Code (PHP)
SELECT
`tb_temperature`.`date_temp`,
`tb_temperature`.`areas`,
MAX(`tb_temperature`.`temp_hight`) as temp_hi,
`tb_temperature`.`temp_low`,
`tb_areas`.`id_areas`,
`tb_areas`.`name_areas`,
`tb_areas`.`prov`,
`tb_province`.`id_prov`,
`tb_province`.`name_prov`
FROM
`tb_temperature`
Inner Join `tb_areas` ON `tb_temperature`.`areas` = `tb_areas`.`id_areas`
Inner Join `tb_province` ON `tb_province`.`id_prov` = `tb_areas`.`prov`
WHERE
MONTH(tb_temperature.date_temp)='$mm' AND YEAR(tb_temperature.date_temp)='$yy'
GROUP BY date_format(tb_temperature.date_temp,'%d')
ORDER BY
`tb_temperature`.`date_temp` ASC
`tb_areas`.`name_areas` กับ ค่ามันไม่ตรงกัน
|
 |
 |
 |
 |
Date :
2010-05-17 15:53:29 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยบอกหน่อยครับ
|
 |
 |
 |
 |
Date :
2010-05-17 17:05:53 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|