Hey all,
I am trying to create a query that would pull the top three recent dates for a part along with any extra data I need to add.
I know how to pull the Last and First but I am confused how I would pull the top three by most recent date.
Next, I would like to count them by the part it pulls, for example.
PART: 12345, Number: 1, Date: 10/10/2016
PART: 12345, Number: 2, Date: 9/10/2016
PART: 12345, Number: 3, Date: 8/10/2016
PART: 123456, Number: 1, Date: 9/10/2016
PART: 123456, Number: 2, Date: 7/10/2016
PART: 123456, Number: 3, Date: 3/10/2016
If someone could help with the SQL coding of this, that would be awesome. I am new to SQL still and I know basic SQL.
I am trying to create a query that would pull the top three recent dates for a part along with any extra data I need to add.
I know how to pull the Last and First but I am confused how I would pull the top three by most recent date.
Next, I would like to count them by the part it pulls, for example.
PART: 12345, Number: 1, Date: 10/10/2016
PART: 12345, Number: 2, Date: 9/10/2016
PART: 12345, Number: 3, Date: 8/10/2016
PART: 123456, Number: 1, Date: 9/10/2016
PART: 123456, Number: 2, Date: 7/10/2016
PART: 123456, Number: 3, Date: 3/10/2016
If someone could help with the SQL coding of this, that would be awesome. I am new to SQL still and I know basic SQL.