Skip to content
WJunction - Webmaster Forum

[help] Select Distinct - sql

Status
Not open for further replies.

Solutho

Experienced Member
546
2010
62
Hey there, I'm trying to do something quite hard to explain, so I'll add a picture too :D

So, what I want to do is select from a sql table the new entries of the day. This is pretty easy even for a noob like me. Though, those entries have a column called 'categorie' and if there is more than one new entry with the same categorie, it'd select only the last one.
I think facebook uses something like this on the private messages panel. The first message must have a secundary ID number that is passed to the replies.

The solution may be inside the loop, but the sql command would be something like:
Code:
SELECT id, date, categorie, txt FROM products WHERE [categorie does not repeat] AND DATE=$date ORDER BY date DSC;

And here's the image:
ecc51a.png


If you could give me a hand, I'd be really grateful.
Cheers
 
Last edited:

2 comments

Status
Not open for further replies.

About the author

S
Experienced Member · Joined
546
Messages
62
Reactions
28
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom