I want to retrieve always the first record via sql

20 pts.
Tags:
SQL
SQL Database
SQL Record
I want to retrieve always the first record of a group of records i.e. a history of sold articles, I want to see the date of every first sold article

Answer Wiki

Thanks. We'll let you know when a new response is added.

An example of the data you want to get from the query would have been nice.

If you just want to get the date of the first sold article, for every different article, a query like this should do the trick:

<pre>Select article_id, min(sale_date)
From sales
Group by article_id</pre>

As we don’t know your column and table names, you will need to make the necessary changes.

If that’s not what you meant, please provide a little more information, and if possible, some example data.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following