I have a huge table to work with . I want to check if there are some records whose parent_id equals my passing value . currently what I implement this is by using \"select
This query will return 1 if any record exists and 0 otherwise:
SELECT COUNT(1) FROM (SELECT 1 FROM mytable WHERE ROWNUM < 2);
It could help when you need to check table data statistics, regardless table size and any performance issue.