CREATE INDEX BrandKey2 ON Brand(BrandDescription);
On Wed, May 14, 2008 at 7:32 AM, Farzana <[EMAIL PROTECTED]> wrote: > > Thanks for your reply Igor. > > When we checked with the provided query we found that the duplicate values > are present in the BrandDescription. We are working with the device where > the memory is limited. We are suppose to sort the data by > BrandDescription.When we tried with "ORDER BY BrandDescription" in the query > to be executed, its taking more time than we expected. > > Is there any work around to sort the data by BrandDescription physically? > Thanks in advance. > > Regards, > Farzana. > > > > > Igor Tandetnik wrote: > > > > "Farzana" <[EMAIL PROTECTED]> > > wrote in message news:[EMAIL PROTECTED] > >> We are using SQLite and we have the table structure as CREATE TABLE > >> Brand(PcNo numeric(4) Not Null,SubPcNo numeric(4) Not Null,BrandNo > >> numeric(9) Not Null,BrandDescription nVARCHAR(254)Not Null,ST > >> numeric(1),TS numeric(14)) where the index is CREATE UNIQUE index > >> BrandKey1 on Brand(PcNo,SubPcNo,BrandNo). When we use this table in > >> the application we are suppose to sort the datas by > >> BrandDescription.So we tried to create a unique index as CREATE > >> UNIQUE INDEX BrandKey2 on Brand(BrandDescription).But we couldn't > >> able to create the unique index. > > > > Define "couldn't able". What exactly seems to be the problem? Did you > > get an error message? What did the message say? > > > > Is it possible that the values in BrandDescription column are not in > > fact unique? If they are not, then naturally you would get an error > > trying to create a unique index. Try this statement: > > > > select * from Brand > > group by BrandDescription > > having count(*) > 1; > > > > If this returns any rows, you have duplicates. > > > > Igor Tandetnik > > > > > > > > _______________________________________________ > > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > > > -- > View this message in context: > http://www.nabble.com/nVARCHAR-as-unique-index-tp17206197p17223665.html > > Sent from the SQLite mailing list archive at Nabble.com. > > _______________________________________________ > > > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users