<b>delete from emp_main where access_id=5</b>
The above command will delete <b>all records </b>having access_id=5.
You should use something similar to this:
<pre>DELETE FROM emp_main WHERE emp_no = 98198</pre>
On the other hand, if you are executing the SELECT just to determine if the record must be deleted, you could avoid it, and execute a DELETE command with both conditions:
<pre>DELETE FROM emp_main WHERE emp_no = 98198 AND access_id = 5</pre>
This way, if the record has an access_id different from 5, it won’t be deleted.