我想将从数据库中移动的值乘以参数中的“km”值并返回结果,当我使用以下查询时,它给我一个错误,即该点的参数[1]不存在
请帮助我如何计算热量?
public interface FareRateRepository extends JpaRepository<FareRate, Long>{
@Query("select f.moving* :km from FareRate f where f.id=1" )
float calculateFare(@Param("km") Long km);
}
最佳答案
你错过了“:”
select f.moving* :km from FareRate f where f.id=1
关于java - JPA存储库: How to multiply column value by parameter value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44255933/