Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
SELECT record.id, count(*)
FROM record
JOIN record_tags ON (record_tags.record_id = record.id)
WHERE record_tags.tag_id IN (1,2,3) GROUP BY 1 ORDER BY 2 DESC
No way. You cannot store tags in a text field with tags written in a row. To do this, they make a many-to-many relationship, where the tags are in a separate table, the records are separate and there is a table of tag links to records.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question