Why do you need your rowid to be changed?  

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mahalakshmi.m
Sent: Friday, March 14, 2008 1:03 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Rowid After Sorting

Hi,

I am working in 3.3.6 and my table looks like.

 

Id          -          Integer Primary Key

Name    -           Text

 

Id         Name

1                     zzz

2                     xxx

3                     bbb

4                     aaa

 

SELECT rowid,Id,Name FROM MyTable ORDER BY Name;

 

Rowid   Id          Name

 

4         4          aaa

3         3          bbb

2         2          xxx

1   1          zzz

 

But I need my rowid to be chaged as follows.

 

Rowid   Id          Name

 

1         4          aaa

2         3          bbb

3         2          xxx

4   1          zzz

 

I tried with Views but its rowid is not changed.

 

But by creating one new table like

 "create table Temp as select Name from Mytable order by Name;" 

gives the desired result as above.

 

Its taking more time for this.

So I there any other way I can do the same without creating table
because in My table I am having many

 fields and each time I will create and drop the table for each fields.

 

Can anyone please help to solve this.

 

Thanks & Regards,

Mahalakshmi.M

 

 

_______________________________________________
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

Reply via email to