Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index on multiple columns (fields)
Message
From
22/07/2003 23:16:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
22/07/2003 23:13:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00812633
Message ID:
00812634
Views:
22
It can be done, but what do you need this index for? If you use indices are to ensure uniqueness of data, for referential integrity, or to search, it doesn't matter whether the index is ascending or descending (therefore, use an ascending index).

If it is for a report, just use SELECT - SQL, with the ORDER BY clause. Here, you can explicitly use ASCENDING and DESCENDING for individual fields, and you don't need to concatenate everything into a single expression.

>Hi Everyone,
>
>I want to index my table on two columns (item_code + item_date). I want to index in such way that,
>
>Item_date is sorted in descending order and item code is sorted on ascending order.
>
>E.g.
>Item_code Item_date
>========= =========
>Item1 01/01/2003
>Item2 01/01/2003
>Item3 01/01/2003
>Item1 01/04/2003
>item2 01/04/2003
>item3 01/04/2003
>
>The above should be displayed as;
>Item_code Item_date
>========= =========
>Item1 01/04/2003
>Item2 01/04/2003
>Item3 01/04/2003
>Item1 01/01/2003
>item2 01/01/2003
>item3 01/01/2003
>
>Any suggestions???
>
>Cheers
>Shaishav
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform