I want to use jpa @Query and found out that the argument of type String will be enclosed in single quotes ('') in the sql statement automatically. Since it is a subquery, it will cause an SQL error:
@Query(value="select cate_id,dt,channel,game_id,new_income_money,new_account,consume from ? " +
" where cate_id=? and dt between ? and ?" ,nativeQuery = true)
List<TfData> findTfRangeData(String subsql, Integer cate_id, String start_dt, String end_dt);
What can I do to prevent this behaviour?


