Hi to all good people out there!
I need a little help with one sql query. Suppose we have one table with data like this:
Date ID
-----------------
4-1-2013 10
4-2-2013 10
4-3-2013 10
4-4-2013 10
4-5-2013 20
4-6-2013 20
4-7-2013 10
4-8-2013 10
4-9-2013 10
4-10-2013 30
-----------------
Now, I would like to get min and max dates for each ID, but like this:
ID min max
------------------------------
10 4-1-2013 4-4-2013
20 4-5-2013 4-6-2013
10 4-7-2013 4-9-2013
30 4-10-2013 4-10-2013
-------------------------------
Is it possible somehow? Thanks in advance!
B.
I need a little help with one sql query. Suppose we have one table with data like this:
Date ID
-----------------
4-1-2013 10
4-2-2013 10
4-3-2013 10
4-4-2013 10
4-5-2013 20
4-6-2013 20
4-7-2013 10
4-8-2013 10
4-9-2013 10
4-10-2013 30
-----------------
Now, I would like to get min and max dates for each ID, but like this:
ID min max
------------------------------
10 4-1-2013 4-4-2013
20 4-5-2013 4-6-2013
10 4-7-2013 4-9-2013
30 4-10-2013 4-10-2013
-------------------------------
Is it possible somehow? Thanks in advance!
B.