well...
withoout more information here is what i can guess that you have
CREATE TABLE [article] (
[article_id] [int] NULL ,
[catagory_id] [int] NULL ,
[article_name] [char] (10) NULL
)
CREATE TABLE [catagory] (
[catagory_id] [int] NULL ,
[catagory_name] [char] (10) NULL
)
CREATE TABLE [lesson] (
[lesson_id] [int] NULL ,
[lesson_name] [char] (10) NULL
)
CREATE TABLE [xref_lesson] (
[catagory_id] [int] NULL ,
[lesson_id] [int] NULL
)
if this being the case, i crate the following quesy to show which articles are associated to the lesson
SELECT DISTINCT lesson.lesson_id, article.catagory_id, article.article_id
FROM article INNER JOIN
catagory ON article.catagory_id = catagory.catagory_id INNER JOIN
xref_lesson ON catagory.catagory_id = xref_lesson.catagory_id INNER JOIN
lesson ON xref_lesson.lesson_id = lesson.lesson_id
WHERE lesson.lesson_id = 1
and thie next will only displat the catagories associated to the lesson
SELECT DISTINCT lesson.lesson_id, article.catagory_id
FROM article INNER JOIN
catagory ON article.catagory_id = catagory.catagory_id INNER JOIN
xref_lesson ON catagory.catagory_id = xref_lesson.catagory_id INNER JOIN
lesson ON xref_lesson.lesson_id = lesson.lesson_id
WHERE lesson.lesson_id = 1
hope it helps.. If you need more help, plese post more info. such as the tables structure