What is better approach to check existence of an object in database?

```
select count(id) as count from my_table where name="searchedName";

```

**OR**

```
select id from my_table where name="searchedName";

```

And then check if `count > 0` or the object is not null (ORM logic)

**EDIT:**

`select id` to be valid for Oracle.