You are here: Re: sorting based on various data types « MsSQL Server « IT news, forums, messages
Re: sorting based on various data types

Posted by Robin Tucker on 10/01/62 11:19

Use fixed length fields for each number in your "path string", ie:

0001.0001
0001.0002
0001.0003.0001
0001.0003.0002
0001.0003.0003
0001.0004
0A-1.0001
0001.0001.000A.0001

Converting the path is simply a case of removing leading "0" after each
fullstop. This should sort correctly.


"Josh" <jpiche@caut.ca> wrote in message
news:1119356513.427410.173150@z14g2000cwz.googlegroups.com...
> I've been tasked with designing a database to store collective
> agreements. I need to store each sub-article of each article of each
> agreement in it's own row within a table. I'm having difficulty
> figuring out the best way to store each sub-article's identifier so
> they sort properly.
>
> The majority of the collective agreements use numbers in a dotted
> notation, for example:
>
> 1.1
> 1.2
> 1.3.1
> 1.3.2
> 1.3.3
> 1.4
>
> Some agreements mix letters with numbers, such as:
>
> A-1.1
> 1.1.A.1
>
> Any ideas how I should deal with this?
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация