为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: dm7 最新版本
【操作系统】: windows 11
【CPU】:
【问题描述】*:
总共1个语句正依次执行...
[执行语句1]:
SELECT (NOW(0)) AS "time1",
"order_form"."id" AS "[order_form].id",
"order_form"."customer_name" AS "[order_form].customer_name",
"order_form"."selling_price" AS "[order_form].selling_price",
"order_form"."created_time" AS "[order_form].created_time",
"product"."id" AS "[product].id",
"product"."product_name" AS "[product].product_name",
"brand"."id" AS "[brand].id",
"brand"."name" AS "[brand].name"
FROM "rcpr_prod_damengtest2_DMheng"."order_form"
LEFT JOIN "rcpr_prod_damengtest2_DMheng"."product"
ON (order_form.productid = product.id)
LEFT JOIN "rcpr_prod_damengtest2_DMheng"."brand"
ON (order_form.brandid = brand.id)
WHERE (order_form.customer_name LIKE CONCAT(CONCAT('%', ''), '%')
OR product.product_name LIKE CONCAT(CONCAT('%', ''), '%')
OR order_form.delivery_date >= ''
AND order_form.delivery_date <= '')
AND (order_form.delivery_date < time1)
ORDER BY order_form.id Desc
执行失败(语句1)
-2111: 第20 行附近出现错误:
无效的列名[time1]
1条语句执行失败
1.看样子 塞选条件是不支持自定义列? 分析筛选条件的时候 忽略select 对象里的自定义列,或者说是别名
2.group by 里也存在这个问题,官方的pdf里也明确说明了,但实际这种使用自定义列分组的场景还是蛮多的,需要处理数据后分组,不知道有什么解决方案没?
order_form.delivery_date < time1,time1改成"time1"试试
查询语句是不是语法不对或者比较列的字段类型不相同。

这边验证自定列可以做筛选条件。