Using DISTINCT and COUNT together in a MySQL Query

前端 未结 7 903
旧巷少年郎
旧巷少年郎 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:41

    use

    SELECT COUNT(DISTINCT productId) from  table_name WHERE keyword='$keyword'
    

提交回复
热议问题