7/22/2013 0 Comments SQL: Select the minimum and maximum values of a column grouped by another column for a given where clause.select p.version, min (p.launch_date) as first, max(v.launch_date) as last
from product p where p.id = '1234' group by p.version, p.id order by p.version The above query selects the first and last launch dates for every version (major version number assumed) of a given product with id 1234
0 Comments
Leave a Reply. |