开发者

Mysql Query problem in searching record

Query:

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'

I have 2 record first record title is

" LCD proj开发者_Python百科ector,plasma display,recording speaker products"

and second record title is

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

But from the above query I am not related result what is problem with it ?


My guess is the t2.ads_activate value isn't "Yes" and/or the t1.ads_type value isn't "offering". Try:

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)

If the records you expect are returned, add the missing WHERE clauses , testing them one at a time. Otherwise, there's something with your JOIN...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜