Home php/mysql query not working
Reply: 0

php/mysql query not working

user675
1#
user675 Published in April 22, 2018, 5:59 pm

my sql query is :

SELECT
    wp_news_contents.*,
    (SUM(IF(sumset,1,0))/(COUNT(wp_news_tags.tag_id) +2)) AS jaccard,
    (
        SELECT GROUP_CONCAT('wp_news_tags.tag_id=',tag_id SEPARATOR ' || ')
        FROM wp_news_tags
        WHERE content_id = 1
    ) AS sumset
FROM wp_news_contents, wp_news_tags
WHERE wp_news_contents.id = wp_news_tags.content_id
AND wp_news_tags.content_id != '1'
AND jaccard > 0.5
GROUP BY wp_news_contents.id
ORDER BY id DESC
LIMIT 0, 5

but query not working and show error :

jaccard columns not defined

what is wrong & how to solve it ?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307596 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO