Selecting a distinct values and its number of occurrence from database

Selecting a distinct values and its number of occurrence from database using SQL

$query=”SELECT DISTINCT(`page_id`), COUNT(page_id) as count FROM tablename group by page_id”;