Hello!
I am not as proficient with SQL as I used to be, so I am having trouble writing a query. Here is the table structure:
ID (auto-incrementing)
PrimaryProductKey
RelativeProductKey
LastIndexed (datetime)
A sample dataset would be:
1, 2, 1, 2008-02-06 10:27:18
2, 2, 2, 2008-02-05 10:27:18
3, 2, 1, 2008-02-04 10:27:18
4, 5, 1, 2008-02-06 9:00:00
I would like to find a) the MAX datetime stamp per PrimaryProductKey key, and then b) find the MIN of that result. So for this dataset, that would return a) 2008-02-06 10:27:18, 2008-02-06 9:00:00 and then b) 2008-02-06 9:00:00 . I don't really need the results from a, I just need the final datetime stamp returned from b.
Thanks so much for your help!
-- Megan
I am not as proficient with SQL as I used to be, so I am having trouble writing a query. Here is the table structure:
ID (auto-incrementing)
PrimaryProductKey
RelativeProductKey
LastIndexed (datetime)
A sample dataset would be:
1, 2, 1, 2008-02-06 10:27:18
2, 2, 2, 2008-02-05 10:27:18
3, 2, 1, 2008-02-04 10:27:18
4, 5, 1, 2008-02-06 9:00:00
I would like to find a) the MAX datetime stamp per PrimaryProductKey key, and then b) find the MIN of that result. So for this dataset, that would return a) 2008-02-06 10:27:18, 2008-02-06 9:00:00 and then b) 2008-02-06 9:00:00 . I don't really need the results from a, I just need the final datetime stamp returned from b.
Thanks so much for your help!
-- Megan