Invalid SQL: INSERT INTO `swsessions` (`sessionid`, `ipaddress`, `lastactivity`, `useragent`, `isloggedin`, `sessiontype`, `typeid`, `dateline`, `status`) VALUES('d12b25cf41920656a893e3b3a517ab50', '54.81.154.223', '1498227814', 'CCBot/2.0 (http://commoncrawl.org/faq/)', '0', '40', '0', '1498227814', '0'); (The table 'swsessions' is full)
Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\support.inm.com\includes\functions.php:410) in C:\Inetpub\support.inm.com\includes\functions.php on line 1612
Sorting a selection on two or more fields - Support Center
inm logo
Corporate Website | Contact | Store | Support | Login  
     


Knowledgebase
View categorized listing of all common frequently asked questions.
Downloads
View our categorized library of downloads for all necessary manuals, software, etc.
 Article Options
Support Center » Knowledgebase » INM V12 Database for Director » Sorting a selection on two or more fields
Support Page Banner
 Sorting a selection on two or more fields
Product:Platform:Area:Version:
INM V12 Database for Director Windows, Macintosh Sorting and Indexes 3.x Regular & Light

Summary

mOrderBy can only sort on one field. However it is possible to sort a selection on multiple fields by defining a compound index.

Example

If you want your table to be sorted by F2 then by F3 and finally by F1, you would need to create your database with the following index:

[Table]
F1 string 255
F2 string 255
F3 string 255
[Indexes]
F231Index duplicate F2 ascending F3 ascending F1 ascending
[End]

This way, if you call mSetCriteria using F1, F2, F3 and then mSelect, the selection will be automatically sorted - you will not need to use mOrderBy!

Note that if your database contains another compound index on F2 and F3, and you call mSetCriteria with F2 and F3 only (not including F1), INM V12 Database will automatically call this [better suited] index. To force INM V12 Database to use F231Index, add a call to mSetCriteria with F1.

For more information about Indexes see: Optimizing your database with indexes.



Article Details
Article ID: 96
Created On: 26 Sep 2006 01:53 PM

 This answer was helpful  This answer was not helpful

inm general footer
Services Xtras Go Products Support Gallery Store Download About Us Contact Newsroom