hi all, I'm new to mysql so please can you help me. I have 2 tables "words" and "text"
words has columns:
- word
- synonyms
text has columns:
- text
- word
- article_id
I need to get unique words.word, and biggest unique text.atricle_id fields. The same article_id can have different words. for example
words
word synonyms
-----------------------
car auto, vehicle
water syn1, syn2
bus syn1, syn2
text
text word article_id
---------------------------------------
any text car 1
any_text water 1
any_text water 2
any_text car 2
any_text bus 1
any_text bus 3
I need to get the result:
car | 2
water | 1
bus | 3
I have a query but it return non unique article_id
SELECT words.word, text.article_id
FROM `words` , `text`
WHERE text.word = words.word
GROUP BY words.word
ORDER BY text.article_id DESC