• Welcome, Guest. Please login.
 
September 17, 2019, 10:13:54 am

News:

Welcome to the SQLitening support forums!


Order by question.....

Started by Gary Stout, February 06, 2011, 04:19:59 pm

Previous topic - Next topic

Gary Stout

This is really going out on a limb, and if it is not possible, I think I have another solution in mind, but I have a column in one of my tables called "Family Position". This column only contains 3 values, Head of House, Spouse, Child. Is it possible to have the results that are displayed in a listview "ordered by" Head of House, Spouse and then Child? Right now the results are ordered by Last Name and then First Name.

Thanks again,
Gary
Gary Stout
gary@sce4u.com

Fred Meier

Try this
Order by case FamilyPosition when 'Head of House' then '1' when 'Spouse' then '2' else '3' end"
SQLite has many helpful experssions http://www.sqlite.org/lang_expr.html

Gary Stout

Thanks Fred,

I will give that a try. My other thought was just to change the info in that field to either 1,2, or 3 and sort it based on those values. I use that field for a couple different purposes.

Thanks again,
Gary
Gary Stout
gary@sce4u.com