开发者

Mysql removing duplicates based on one column

I am using the query below

      $result2 = mysql_query("select * from HandsetStock WHERE SubCategory NOT LIKE '%clearance%'", $dbh2);

I am getting a few duplicate results which I want to eliminate from the results however they are not completely duplicate rows. The column name is Make. I am guessing i need some kind of subquery but I am struggling to get it to work for me. Basically I need to select a开发者_如何学Pythonll records but where Make has the same value just the first record.

Thanks


 $result2 = mysql_query("select * from HandsetStock 
                        WHERE SubCategory NOT LIKE '%clearance%' 
                        group by Make", $dbh2)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜