且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我的搜索没有找到结果!

更新时间:2023-02-09 14:58:31

您没有任何一条符合您所有条件的记录。让我这么快就试着让你快速通过它:


您的数据:
You don''t have any one record that matches all of your criteria. Let
me try to step you through it real quick:

Your data:
item_id item_name item_key item_value
---------------------------------------------- ----
1 Gefore MX 440尺寸64 MB
1 Gefore MX 440架构64位
1 Gefore MX 440 AGP 8x
1 Gefore MX 440芯片组Nvidia
1 Gefore MX 440供应商华硕
2 AMD 3200+级插槽A 2 AMD 3200+速度2 GHz
2 AMD 3200+架构32位
2 AMD 3200+ 2级缓存512 KB
2 AMD 3200+供应商AMD
3戴尔P780几何17英寸
3戴尔P780屏幕类型平板
3戴尔P780频率60赫兹
3戴尔P780供应商戴尔


您的搜索: - 完整搜索是amd socket a 32 bit cache 512 dell



您的WHERE子句:

((item_name类似''%''+ @ search_key1 +''%'')或(item_key比如''%''+
@ search_key1 +''%'')或(item_value喜欢''%''+ @ search_key1 +''%''))


crieria 1发现其中包含AMD的所有行:

2 AMD 3200+ Class Socket A
2 AMD 3200+ Speed 2 GHz
2 AMD 3200+架构32位
2 AMD 3200+ 2级缓存512 KB
2 AMD 3200+供应商AMD



((item_name类似''%''+ @ search_key2 +''%'')或(item_key喜欢''%''+
@ search_key2 +''%'')或(item_value喜欢''%''+ @ search_key2 +''%'' ))


使用并进一步缩小结果集以找到行

,第二个标准:socket a

2 AMD 3200+ Class Socket A
item_id item_name item_key item_value
--------------------------------------------------
1 Gefore MX 440 Size 64 MB
1 Gefore MX 440 Architecture 64 Bit
1 Gefore MX 440 AGP 8x
1 Gefore MX 440 Chipset Nvidia
1 Gefore MX 440 Vendor Asus
2 AMD 3200+ Class Socket A
2 AMD 3200+ Speed 2 GHz
2 AMD 3200+ Architecture 32 Bit
2 AMD 3200+ Level 2 Cache 512 KB
2 AMD 3200+ Vendor AMD
3 Dell P780 Geometry 17 Inch
3 Dell P780 Screen Type Flat
3 Dell P780 Frequency 60 Hz
3 Dell P780 Vendor Dell

Your search: -- the complete search is "amd socket a 32 bit cache 512 dell"

Your WHERE clause:
((item_name like ''%'' + @search_key1 + ''%'') or (item_key like ''%'' +
@search_key1 + ''%'') or (item_value like ''%'' + @search_key1 + ''%''))
crieria 1 finds all rows that have AMD in them:
2 AMD 3200+ Class Socket A
2 AMD 3200+ Speed 2 GHz
2 AMD 3200+ Architecture 32 Bit
2 AMD 3200+ Level 2 Cache 512 KB
2 AMD 3200+ Vendor AMD
and
((item_name like ''%'' + @search_key2 + ''%'') or (item_key like ''%'' +
@search_key2 + ''%'') or (item_value like ''%'' + @search_key2 + ''%''))
the use of the and further narrows down your resultset to finding rows
with the second criteria: socket a
2 AMD 3200+ Class Socket A




第三个标准是32位,它排除了你的前一行你好

结果集,所以你没有得到任何结果。


有更好的方法来做这个设计,但最终,你是

将不得不使用OR作为搜索条件的一部分。


HTH,

Stu



the third criteria is 32 bit, which excludes the previous row from your
result set, so you get no results.

There are much better ways to do this design, but ultimately, you''re
going to have to use an OR as part of your search criteria.

HTH,
Stu


感谢您的回复,使用OR它会起作用,但我认为因为item_table和details_table之间的

关系是1-M所以那些

许多细节都在一个或多个项目中。有没有办法在所有这些中找到

的结果?

实际上item_id 2是AMD 3200 +确实有它

所有细节" amd socket 32​​ bit cache 512 dell"除了dell

和item_id 3,它是Dell P780。在它下面有dell;怎么可以包括所有没有OR?

我的理由是用户搜索会假设他会得到一个

包括全部的结果作为必须而非选择。


***的问候

Thanks for replying, Well with OR it will work, but i think because the
relationship between item_table and details_table is 1-M so all those
many details are within one or more items. Is there a way to find
results within all of them?
Actually the item_id 2 which is "AMD 3200+" does indeed have under it
all of the details "amd socket a 32 bit cache 512 dell" except "dell"
and item_id 3 which is "Dell P780" has under it the word "dell"; how is
it possible to include all without "OR"?
My reasoning is that the user searching will assume that he will get a
result that includes "All" as a must and not optional.

Best regards





coosa写道:


coosa wrote:
感谢您的回复,好吧,或者它会起作用,但我认为因为item_table和details_table之间的关系是1-M所以所有那些
很多细节在一个或多个项目内。有没有办法在所有这些内找到
结果?
实际上是item_id 2,它是AMD 3200 +。确实有它的所有细节amd socket a 32 bit cache 512 dell除了dell
和item_id 3,它是Dell P780。在它下面有dell;如何在没有OR的情况下包括所有内容?


如果您要求匹配''dell''的商品,您将获得

商品仅与''dell''相匹配,而您不会回到第2项。


能否请您显示您想要的确切结果,因为它听起来像

您不希望使用的结果并且,但是你不想要使用OR的结果

。但是你的描述在所有这些内容中找到结果

并不完全准确。如果你给出了几个例子,那将会有所帮助

其中OR和AND都没有给你你想要的结果。

Steve Kass

Drew University

我的理由是用户搜索将假设他将获得包含全部的结果。***的问候
Thanks for replying, Well with OR it will work, but i think because the
relationship between item_table and details_table is 1-M so all those
many details are within one or more items. Is there a way to find
results within all of them?
Actually the item_id 2 which is "AMD 3200+" does indeed have under it
all of the details "amd socket a 32 bit cache 512 dell" except "dell"
and item_id 3 which is "Dell P780" has under it the word "dell"; how is
it possible to include all without "OR"?
If you request items matching ''dell'', you will get back
items matching ''dell'' only, and you won''t get back item #2.

Can you please show the exact result you want, since it sounds like
you don''t want the result of using AND, but you don''t want the result
of using OR. But your description "find results within all of them"
is not at all precise. It would help if you gave several examples
where neither OR nor AND gives you the results you want.
Steve Kass
Drew University
My reasoning is that the user searching will assume that he will get a
result that includes "All" as a must and not optional.

Best regards