Page 1 of 1

SORT DATA USING INDEX

PostPosted: Tue May 06, 2014 8:49 pm
by ramu65
hi
I am a beginner in DB2.I created a table and also a unique index for the table.But after inserting data into the table,the contents are not in sorted order(according to the index).

index creation:
create unique index ai_index on xxxxx(jnt_id asc)

where jnt_id is column in table of type char(4)

What might be the possible reason for the data not to be in sorted order??Is there any other method to sort the available data??

Re: SORT DATA USING INDEX

PostPosted: Tue May 06, 2014 9:09 pm
by enrico-sorichetti
as per db2/sql manuals
the only way to retrieve the rows in a specific order is ...
the name tells - use the ORDER clause