Answer the question
In order to leave comments, you need to log in
How to find row in database by column value?
I am writing a small rest service using Spring Boot. I have an entity and an interface that inherits from CrudRepository. I need to get my entity with the necessary data, which must be found by the value of the column. I have only seen repository.findById(). Question: is it possible to find a line in the database by value, not by Id. I am using MySQL. In theory, you can write a sql query, so there must be such a function. So right?
Answer the question
In order to leave comments, you need to log in
select user_id, username, email
from my_table
where email='[email protected]'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question