Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 将数字与单引号进行比较时LIKE子句不返回_Mysql - Fatal编程技术网

Mysql 将数字与单引号进行比较时LIKE子句不返回

Mysql 将数字与单引号进行比较时LIKE子句不返回,mysql,Mysql,我有一个查询包含一个字段事务id和数据类型integer 在下面查询的WHERE条件中,我有LIKE操作符,在这种情况下,如果我给出事务id,比如'00412552',我没有获取数据 假设我给出交易id,比如00412552,那么我得到的是数据 我认为它不是以字符串类型作为运算符,请说明问题所在 SELECT DISTINCT crt.carton_no, crt.shipment_ref_no, crt.put_away_

我有一个查询包含一个字段
事务id
和数据类型integer

在下面查询的
WHERE
条件中,我有
LIKE
操作符,在这种情况下,如果我给出
事务id,比如'00412552',
我没有获取数据

假设我给出交易id,比如00412552,那么我得到的是数据

我认为它不是以字符串类型作为运算符,请说明问题所在

 SELECT DISTINCT crt.carton_no, 
                 crt.shipment_ref_no,
                 crt.put_away_location,
                 crt.item_category,
                 crt.total_quantity     
            FROM carton crt 
RIGHT OUTER JOIN pick_list pl 
              ON (crt.carton_no = pl.carton_no AND 
                 crt.shipment_ref_no = pl.shipment_ref_no) 
           WHERE pl.transaction_id LIKE '00412552'

我认为您的第一个示例应该是'00412552'中的
?您需要将中的
运算符与括号结合起来:
在('00412552')
中,即使只有一个元素。如果事务_id是一个整数,那么为什么不使用=(equal)运算符hi sonali和dognose类似于运算符的运算符呢。事务id如“00412552”的位置您试图解决什么问题?列事务id包含带前导零的值?