posted 8 years ago
I have a question in Sorting....

I hava object, lets say car

and it has the properties:

car_id

color,

year,

make

cost,

Lets say I have 10 cars...

and I want to sort the cars in this following order...

order by color, then order by year..., make, cost...

So basically,

for ex:

I have 5 red cars, 3 blue and 2 green...

ex: 1-Red,2-Red, 3-Red, 4-Red, 5-Red

sort those 5 red cars then by year....say... 1-Red=1996, 3-Red=1996, 4-Red=1996, 5-Red=1998, 2-Red=1999.....etc

then sort by make....

say..

4-Red=1996=Dodge, 3-Red=1996 =Dodge, 1-Red=1996=Toyoto, etc

then by cost

3-Red=1996=Dodge=16K, 4-Red=1996 =Dodge=17K, etc

You get the point....?

what is the best way to do this........

Thanks!