查询什么也不返回 [英] Query returning nothing

查看:122
本文介绍了查询什么也不返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查询如下:

Select h.ord_no
from sales_history_header h
INNER JOIN sales_history_detail d
ON d.NUMBER = h.NUMBER 
WHERE d.COMMENTS LIKE '%3838CS%'

我没有得到如下所示的结果:

And I get no results as shown here :

但是我应该得到结果,因为:

But I should get results because :

我运行了查询:

Select NUMBER, Comments from SALES_HISTORY_DETAIL WHERE NUMBER LIKE '%0000125199%'

并得到了它(如您所见,其中包含一个带有3838CS的注释字段):

and got this (As you can see there's a comment field with 3838CS contained in it) :

并运行以下查询:

Select NUMBER, Ord_No from "SALES_HISTORY_HEADER" WHERE NUMBER = '0000125199'

得到了这个(Ord_No存在):

and got this (The Ord_No exists) :

为什么我的第一个原始查询没有返回结果?我的语法是否错误?

How come my first original query returns no results? Do I have the syntax wrong ?

推荐答案

我认为这是因为两个表中数字的数据类型不同

I think this is because you have different data type for number in both table

这篇关于查询什么也不返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆