gpt4 book ai didi

sql - Mysql查询查询记录时出现的问题

转载 作者:行者123 更新时间:2023-11-29 02:37:09 25 4
gpt4 key购买 nike

查询:

SELECT t1.id,
t1.ads_city,
t1.ads_title,
t1.ads_description,
t1.ads_type,
t2.ads_activate,
t2.postads_id,
t2.ads_id
FROM table_1 t1
JOIN nextpostads t2 ON t1.id = t2.postads_id
WHERE MATCH(t1.ads_title,t1.ads_description) AGAINST ('LCD projector ,' IN BOOLEAN MODE)
AND t2.ads_activate='Yes'
AND t1.ads_type='offering'

我有2条记录第一个记录标题是

" LCD projector,plasma display,recording speaker products"

第二条记录的标题是

" Interactive products(projection screen,projectors,touch panel,network camera)"

但是从上面的查询中我没有得到相关的结果,它有什么问题吗?

最佳答案

我的猜测是 t2.ads_activate 值不是“Yes”和/或 t1.ads_type 值不是“offering”。尝试:

SELECT t1.id,
t1.ads_city,
t1.ads_title,
t1.ads_description,
t1.ads_type,
t2.ads_activate,
t2.postads_id,
t2.ads_id
FROM table_1 t1
JOIN nextpostads t2 ON t1.id = t2.postads_id
WHERE MATCH(t1.ads_title,t1.ads_description) AGAINST ('LCD projector ,' IN BOOLEAN MODE)

如果返回了您期望的记录,请添加缺少的 WHERE 子句,一次测试一个。否则,您的 JOIN 有问题...

关于sql - Mysql查询查询记录时出现的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3525012/

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