SQL-like select - how to get number of rows of result table

I use SQL-like select statement to get the table of unique pairs

SELECT distinct p1.name, p2.name INTO ResTable
FROM vertex1:p1-()-vertex2:p2 ;

But how can I after this get number of records?

I want something like


but it is not allowed

Thank you