2015-03-02 37 views
-1
mysql> SELECT MIN(elevation_in_meters) as AE,common_name 
    -> FROM paplants 
    -> WHERE common_name="common lilac" 
    -> OR common_name="eastern redbud" 
    -> OR common_name="rugosa rose"; 

我只獲得了數據「共同丁香花」,但我也應該爲「東方紫荊」和獲取數據「藿香玫瑰」OR條件不返回數據

+0

您還可以使用[IN](http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_in)子句 – 2015-03-03 01:50:53

回答

0

添加GROUP BY common_name。這應該有所幫助。