Using DISTINCT and COUNT together in a MySQL Query

前端 未结 7 923
旧巷少年郎
旧巷少年郎 2020-11-30 22:04

Is something like this possible:

SELECT DISTINCT COUNT(productId) WHERE keyword=\'$keyword\'

What I want is to get the number of unique pro

7条回答
  •  日久生厌
    2020-11-30 22:40

    What the hell of all this work anthers

    it's too simple

    if you want a list of how much productId in each keyword here it's the code

    SELECT count(productId),  keyword  FROM `Table_name` GROUP BY keyword; 
    

提交回复
热议问题