Sets of things inherently have no order. Since you have not specified an order (as in an order by clause), any ordering you perceive is simply a figment of your imagination and does not, in reality, exist.
You can always add another column and put your order in it so that you can sort by that column, or retrieve the rows one at a time so that your application can deal with them sequentially. However, set-based data management systems do not have any inherent order in sets of rows processed ... --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-----Original Message----- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Hegde, Deepakakumar >(D.) >Sent: Friday, 9 March, 2018 06:15 >To: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] How to get the entry from sqlite db without primary >key or rowid order? > >Hi All, > > >We have a problem as below: > > >we have created a table as below: > >CREATE TABLE NEWFOLDER(ID INTEGER PRIMARY KEY, NAME TEXT NOT NULL) ; > >We have inserted 5 entry to this table, and ID will be from 1 to 5 as >below > >ID NAME >1 ABC > >2 AAA > >3 CBA > >4 BAC > >5 BBB > > >We execute following select statetment: > > >SELECT * FROM NEWFOLDER WHERE ID IN (3,1,2); > > >output for above is: > > >ID NAME > >1 ABC > >2 AAA > >3 CBA > > >It seems by default sqlite is getting the entry in the order of >primary key or rowid. > > >So for us expected output is: > >ID NAME > >3 CBA > >1 ABC > >2 AAA > > >Is there anyway to do this without adding a new column? with the same >table? > >we need a way where by we can get the entry as we given in "where" >"in" clause > > >Thanks and Regards > >Deepak > > >_______________________________________________ >sqlite-users mailing list >sqlite-users@mailinglists.sqlite.org >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users