Jump to content

Distinct Problems


greenday

Recommended Posts

Hi, i have 2 tables 'articles' and 'articlecategory' they are linked together with articlecategoryid. I want to see each category heading with the latest story summary underneath it:

 

Article Heading 1

Article summary here

 

Article Heading 2

Article summary here

 

Article Heading 3

Article summary here

 

Here is my sql

 

"SELECT DISTINCT articlecategory.articlecategoryname, articles.articlecategoryid, articles.articleid, articles.articlesummary FROM articles, articlecategory WHERE articles.articlecategoryid = articlecategory.articlecategoryid "

 

But I get duplicate article headings for each story that is in it. Any ideas please?

Link to comment
https://forums.phpfreaks.com/topic/79502-distinct-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.