For more information, see SQL statements.
Topic, field to_id to_title
Knowledge Point Table tag, field t_id t_title
Join table relation, field to_id t_id
Each question can have multiple knowledge points
The search box is provided on the web interface. you can select more knowledge points for 10 questions on each page. The problem is that there are duplicate data.
Select topic. to_id, topic. to_title from topic, relation where (topic. to_id = relation. to_id) and (t_id in (1, 2, 3 ));
Now, if the knowledge points 1, 2, and 3 are corresponding to the to_id of 1, three identical questions will appear. However, if the repetition is removed, it is in conflict with 10 entries on each page. I would like to ask the seniors about the related SQL statements. thank you very much !!!
Reply to discussion (solution)
Select distinct (topic. to_id, topic. to_title) from topic, relation, tag where (topic. to_id = relation. to_id) and (t_id in (, 3) limit;
Use group