On Fri, Jul 22, 2011 at 09:23:36AM +0200, Sintoni Stefano (GMAIL) scratched on the wall: > Hi, > I get a strange result using JOIN on one very simple application using > SQLite.
> The table ELAB are populated with the follow SQL query: > INSERT INTO ELAB SELECT CODE.* FROM JOB JOIN CODE ON CODE.CODE=JOB.CODE > and I take the follow result. > CODE;VALUE; > 61311;18461F; > 61311;18462F; > 61311;18461F; > 61311;18462F; > > That is the problem. > But I should have this result > CODE;VALUE; > 61311;18462F; > 61311;18461F; > 61311;18462F; > 61311;18461F; In SQL terms, these are the exact same. Table rows are *unordered* and can be returned in any order the database wants. If you need a result in a specific order, you must use an ORDER BY clause in your SELECT statement. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

