gpt4 book ai didi

java - 如何比较 SQL where 条件中的两个逻辑表达式?

转载 作者:搜寻专家 更新时间:2023-11-01 03:18:53 27 4
gpt4 key购买 nike

<分区>

我想要两个比较两个 SQL where 子句来检查条件是否相似。

在下面的示例中,SQL 查询在 where 子句中具有相同的逻辑条件。什么操作应该告诉我两个 where 子句条件在逻辑上相同?

是否有用于此的正则表达式?还有其他方法吗?

String Q3 = "select t1.ID as ID,t1.FIELD8 as I_RECHARGE_TYPE,t1.FIELD28 as I_RECHARGE_AMOUNT,t1.FIELD1 as I_ACTIVATION_DATE,t1.FIELD2 as I_MSISDN from INSTANT_CDR_0 as t1 where t1.FIELD2 = ? and ((((t1.FIELD8 IS NOT NULL  AND  t1.FIELD28 > 0) OR  DATE_FORMAT(t1.FIELD1,'%Y-%m-%d') > '2016-05-21')) or ((DATE_FORMAT(t1.FIELD1,'%Y-%m-%d') < '2015-12-03' OR ( t1.FIELD28 > 0 AND  t1.FIELD28 < 101))))";
String Q4 = "select t1.ID as ID,t1.FIELD1 as I_ACTIVATION_DATE,t1.FIELD8 as I_RECHARGE_TYPE,t1.FIELD28 as I_RECHARGE_AMOUNT,t1.FIELD2 as I_MSISDN from INSTANT_CDR_0 as t1 where t1.FIELD2 = ? and (((DATE_FORMAT(t1.FIELD1,'%Y-%m-%d') > '2016-05-21' OR ( t1.FIELD8 IS NOT NULL AND t1.FIELD28 > 0))) or (((t1.FIELD28 > 0 AND t1.FIELD28 < 101) OR DATE_FORMAT(t1.FIELD1,'%Y-%m-%d') < '2015-12-03')))";

如何比较 ((a=2) and (b=3))((b=3) and(a=2)) 并找出它们是一样的吗?

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com