Quote Originally Posted by tamilselvan
You don't need to select "detail.p_date AS grp0" column.

Code:
Try this:

 SELECT COUNT(*) 
 FROM (
    SELECT distinct a.pkey   
       FROM detail a, agg_tbl b
     WHERE TO_CHAR(a.pkey) = b.detail_pkey
         AND b.agg_id  = '0b080e0000010876d429ad0a1428098500' );
Tamil

I should have been more clear on this. I only encapsulated the query in a select count(*) so that I could find out how long it takes to get the data from the query. Looking at the data when I am doing the query is not as important.