Question: In case I only provide a single value, are the following `sql` statements equivalent (eg in terms of performance)?

```
SELECT * FROM mytable where lastname IN(:lastnames);
SELECT * FROM mytable where lastname = :lastname;

```

Background: I have service that should serve a list, and a service that serves a single result. Now I thought why creating two database query endpoints, if I could achieve the same thing with just one query (means: also a single result could be queried by using the `IN` clause).

Answer: 
Assuming your db's engine is optimised and would check if there is one value inside the IN parameters and "convert" it to an equal/do the correct operation it would still be technically longer than just a written equal.

Also see [this](https://stackoverflow.com/questions/1013797/is-sql-in-bad-for-performance) about IN performance.
Use This Query.
It May Be Solve Your Problem.

SELECT \* FROM mytable where lastname IN(SELECT lastname FROM mytable where lastname = :lastname);