Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Is a Sort Column okay?

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 05-12-2013, 05:58 AM PM User | #1 doubledee Regular Coder     Join Date: Mar 2011 Location: Arizona Posts: 888 Thanks: 21 Thanked 0 Times in 0 Posts Is a Sort Column okay? I just finished adding Section, Dimension, and SubSection columns to my database. When I start joining the tables in various ways, I am not getting things in the order I want. Would it be okay to add a column called "sort" and manually assign a "Sort Order #" so I have something on which to run my ORDER BY against? For example, I want things in this order... Code: ```Featured Finance Business Structure Store Type Offering Accounting``` Also, if it is okay to do this for one table, would it be a major deal to do it on several tables, e.g. my Section, Dimension, and SubSection tables? Sincerely, Debbie
 05-12-2013, 07:53 AM PM User | #2 Old Pedant Supreme Master coder!     Join Date: Feb 2009 Posts: 24,968 Thanks: 75 Thanked 4,310 Times in 4,277 Posts Sure. I do this all the time. But take a hint from the olden days of when BASIC had line numbers and most people numbered their lines in increments of 10 ( 10, 20, 30, ... ). Do that with your ordering column. Now, if you change your mind about one number, you don't have to shuffle all the numbers around. Say you had, indeed, 10 20 30 40 and you decided the 30 really should be before 20. So just change 30 to 15. 10 15 20 40 Presto. (Heck, I can remember numbering by 100 on occasion.) __________________ An optimist sees the glass as half full. A pessimist sees the glass as half empty. A realist drinks it no matter how much there is.
05-12-2013, 04:15 PM   PM User | #3
doubledee
Regular Coder

Join Date: Mar 2011
Location: Arizona
Posts: 888
Thanks: 21
Thanked 0 Times in 0 Posts
Quote:
 Originally Posted by Old Pedant Sure. I do this all the time.
That's good, because while I love my new Data Model, I found out pretty quickly last night that my "Natural Keys" in the junction tables were very short lived as far as simplifying my queries...

Quote:
 But take a hint from the olden days of when BASIC had line numbers and most people numbered their lines in increments of 10 ( 10, 20, 30, ... ). Do that with your ordering column. Now, if you change your mind about one number, you don't have to shuffle all the numbers around. Say you had, indeed, 10 20 30 40 and you decided the 30 really should be before 20. So just change 30 to 15. 10 15 20 40 Presto. (Heck, I can remember numbering by 100 on occasion.)
Thanks for the tip!

Sincerely,

Debbie

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 02:04 AM.