count unique values sqlite3 code example Example: mysql unique select count SELECT COUNT(DISTINCT productId) from table_name WHERE keyword='$keyword'