问题描述
以下是回答理解系统所需的表格和数据的转储:-
该系统由导师和班级组成.All_Tag_Relations 表中的数据存储了每个注册的导师和一个导师创建的每个班级的标签关系.标签关系用于搜索类.
The system consists of tutors and classes. The data in the table All_Tag_Relations stores tag relations for each tutor registered and each class created by a tutor. The tag relations are used for searching classes.
以下是我的查询:-
此查询在标签"表中搜索first class"(first = 3 和 class = 4 的标签)并返回所有这些类,以便在类名称中同时出现词 first 和 class.
This query searches for "first class" (tag for first = 3 and for class = 4, in Tags table) and returns all those classes such that both the terms first and class are present in the class name.
它返回 id_wc = 1 的类.
And it returns the class with id_wc = 1.
但是,我希望搜索显示所有这些课程,以便所有搜索词都出现在课程名称或其导师名称中因此,搜索Sandeepan class"(wtagrels.id_tag = 1,4)或Sandeepan Nath"也会返回 id_wc=1 的类.和搜索.搜索Bob First"不应返回任何类.
But, I want the search to show all those classes such that all the search terms are present in the class name or its tutor name So that searching "Sandeepan class" (wtagrels.id_tag = 1,4) or "Sandeepan Nath" also returns the class with id_wc=1. And Searching. Searching "Bob First" should not return any classes.
请修改上述查询或建议新查询,如果可能,请使用 MyIsam - 全文搜索,但以某种方式帮助我获得结果.
Please modify the above query or suggest a new query, if possible using MyIsam - fulltext search, but somehow help me get the result.
推荐答案
我认为这个查询会对您有所帮助:
I think this query would help you:
它返回id_wc = 1
.
对于 (6, 3) 查询不返回任何内容.
It returns id_wc = 1
.
For (6, 3) the query returns nothing.
这篇关于Mysql - 帮助我更改此搜索查询以获得所需的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!