0

我想将此带有函数的 mysql/select 查询转换为 DBIx::Class 但我无法以正确的方式构造它。

具有功能的 Mysql/查询:

mysql> select * from sold_products 
       where date_sub(curdate(), interval 100 day) <= date;

DBIC_TRACE 上的结果查询:

SELECT me.fk_product, me.fk_customer, me.amount, me.quantity, me.date, me.pk_sold 
FROM sold_products me WHERE ( date > date_sub(curdate(), interval 100 day ):

PS DBIx 已经升级。

谢谢,羽扇豆

4

1 回答 1

0

在您的 DBIx 查询中,您希望哈希键为“>=”,而不是“>”。日期 => {'>=',whatever_here }?你已经试过了吗?

于 2011-06-13T21:27:03.253 回答