I am facing a problem with sql query.
i want an output in the order
900
1200
1500
1800
2100
2400
2700
3000
whenever i am running a query ::
SELECT length FROM product_dimensions WHERE category_id=2 and sub_category_id=34 GROUP BY length ORDER by min(length) ASC;
i am getting the output
1200
1500
1800
2100
2400
2700
3000
900
if i run order by min(length) DESC
i am getting
900
3000
2700
2400
2100
1800
1500
1200
........
i cannot understand where i am going wrong. Please help me out.
even i have also tried DISTINCT::
SELECT DISTINCT length from product_dimensions WHERE category_id=2 and sub_category_id=34 ORDER BY length ASC;
Here also the output is like above.
1200
1500
1800
2100
2400
2700
3000
900
Please help me with the solutions.