Sitaram, A query with a join isn't any different from a regular query in terms of getting the # rows.
You can use SQL's count(*) or count the rows up as you go through them. (Some drivers let you navigate to the end and get the row number, but that still involves transfering all the data across.