表里的所有数据:

postgresql数据库根据年月查询出本月的所有数据


现在我要根据创建时间的 年月查询 当月所有的数据

比如前台传给我一个年月的字段planTimeMonth,值为2018-06

那么我们需要查询创建时间为6月份的所有数据

sql:

postgresql数据库根据年月查询出本月的所有数据

java代码中sql拼接:

criteria.andCondition("to_char(crt_time, 'yyyy-mm')='"+query.get("planTimeMonth").toString()+"'");

相关文章:

  • 2022-01-02
  • 2021-05-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-24
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案