Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT
- contenu.*,
- users.pseudo AS author_name,
- durees.libelle AS duree_name,
- (SELECT SUM(vote) AS pts FROM contenu_votes WHERE contenu_id = contenu.id) AS votes
- FROM contenu, tags, contenu_tags, users, durees
- WHERE contenu.id = contenu_tags.contenu_id
- AND tags.id = contenu_tags.tags_id
- AND users.id = contenu.createur_id
- AND durees.id = contenu.duree
- AND tags.id in (SELECT * FROM (SELECT id FROM tags ORDER BY levenshtein_pct(search_key, '$key') desc limit 0,5) as t)
- ORDER BY votes DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement