question :
query from table peron ,validate are there any records which name = C
table person like below :
id | name
1 A
2 B
3 C
4 C
5 C
SQL 1 : (more common) SELECT COUNT(*) FROM PERSON WHERE NAME = 'C';
SQL 2 : SELECT 1 FROM DUAL WHERE EXISTS (SELECT * FROM PERSON WHERE NAME = 'C');
COUNT(*) will scan all rows in the person table ,if the record in person is more than 1 million one query may cost many time ; but if we use the exists ,the scan will return immediately when the record been scanned .