bubbadawg Posted August 16, 2010 Share Posted August 16, 2010 I have a recordset that returns real estate data. I need to sort and group the data on two fields property_id and sold (boolean). So I need to have all the properties that are available (not sold) listed by property_id (desc) first and then the remaining (sold) properties listed by property_id (desc). Thanks for the assistance. Quote Link to comment Share on other sites More sharing options...
kickstart Posted August 16, 2010 Share Posted August 16, 2010 Hi Grouping (ie, using GROUP BY) is used when you want to perform a function on several lines and return a combined result. For example if you had a list of cars and their tops speeds and you wanted to know the average speed for each make you would use something like:- SELECT CarMake, AVG(TopSpeed) FROM CarTable GROUP BY CarMake I don't think this is what you want, hence if you had searched for GROUP BY you would likely have got confused. For you query SELECT property_id, sold FROM PropertyTable ORDER BY sold ASC, property_id DESC All the best Keith Quote Link to comment Share on other sites More sharing options...
bubbadawg Posted August 16, 2010 Author Share Posted August 16, 2010 Hi, Thanks for your assistance. I think that will work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.