I have table with city and country together. I try select city and country name by some first letters with LIKE but everytime it returns empty list. In MySql Workbench this query return result. I try many version but nothing work.
@Query(value = "SELECT city, country FROM test8.cities WHERE city LIKE ?'%'", nativeQuery = true)
List<City> findCity(String str);
I try and this methods also return empty list.
List<City> findByCityStartsWith(String str);
List<City> findTop20DistinctByCityIsStartingWith(String str);
@Query(value = "SELECT city, country FROM test8.cities WHERE city LIKE ?1", nativeQuery = true) List findByCityIsStartingWith(String str);
@Query(value = "select city, country FROM test8.cities WHERE city = :str", nativeQuery = true) List findByCity2(@Param("str")String str);