I've a site where companies add their article.
I'de like to provide a "lasts articles" table. By this, I'll show last
articles inserted. But I won't always the same articles at any refresh.
Question 1: how to get a "random" selection from the database, giving more
priority to the last inserted (the ones with higher articleID)
Question 2: I'd like to provide one article by client. I won't show 3
articles from the same client only because he has been the last one to
insert his articles.
So I must randomly select by choosing between last articleID, but only one
per clientID.
simplified table is:
articleID
clientID
details
price.
It is possible with MySQL ? or any idea how to achieve this ?
PS:I've no access to mysql NG.
BOB
I'de like to provide a "lasts articles" table. By this, I'll show last
articles inserted. But I won't always the same articles at any refresh.
Question 1: how to get a "random" selection from the database, giving more
priority to the last inserted (the ones with higher articleID)
Question 2: I'd like to provide one article by client. I won't show 3
articles from the same client only because he has been the last one to
insert his articles.
So I must randomly select by choosing between last articleID, but only one
per clientID.
simplified table is:
articleID
clientID
details
price.
It is possible with MySQL ? or any idea how to achieve this ?
PS:I've no access to mysql NG.
BOB
Comment