Skip to content

Commit

Permalink
fix: query random
Browse files Browse the repository at this point in the history
  • Loading branch information
Toto-hitori committed Mar 8, 2024
1 parent 1246a7c commit fa95a8f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import org.springframework.data.jpa.repository.Query;

public interface QuestionRepository extends JpaRepository<Question,Long> {
@Query(value = "SELECT * FROM questions ORDER BY RAND() LIMIT 1", nativeQuery = true)
@Query(value = "SELECT * FROM questions ORDER BY RANDOM() LIMIT 1", nativeQuery = true)
Question findRandomQuestion();
}

0 comments on commit fa95a8f

Please sign in to comment.