Getting count(column) as well as a specific row in each group I am working with SQL Server 2012.

I want to get the count of column as well as the rows with specific condition in each group.

The query I have in mind looks something like this:

select count(column1), (column2 where column2 contains 'page1')
group by column1


I know that the above query isn't correct but I want to show the idea.

Sample data 


column1   column2 
-------  --------
x1       'temp/page1_l'
x1       'temp/page2_f'
x2       'temp/page2_d'
x2       'temp/page1_k'
x2       'temp/page2_e'


Expected output 


count(column1)  column2 
--------------  --------------
2               'temp/page1_l'
3               'temp/page1_k'


How can I achieve that output?
For the (column2 where column2 contains 'page1') expression, try something like:

MAX(CASE WHEN Column2 LIKE '%page1%' THEN Column2 END)


...but I'm not sure what you expect if you have multiple rows with "page1" per column1.