On Wed, Sep 15, 2010 at 08:05:26PM +0200, Stef Mientki wrote: > On 15-09-2010 11:36, Benoit Mortgat wrote: > > Are you sure that after altering your tables adding columns, natural > > join still only joins on vlid? > > > no, very stupid of me !! > I added a column to each of the tables, with the same name, they > should have the same value, but due to another programming error, the > values were different. again, thank all very much !! > > That brings another issue to my mind, which I still don't understand: > "why can we so easily manipulate complex pages of text, by adding / > deleting / copying / pasting etc, and is manipulating of a few tables > in a database so difficult?"
You shouldn't select * and you shouldn't natural joins precisely to avoid these sorts of surprises. Select * is handy for manual queries from a shell; ditto natural joins. Of course, you can always change your schema in such a way as to break existing statements. But the point here is to write statements such that they will be stable in the face of a schema that evolves in a backwards compatible way. When you have to radically change your schema you know you have to update your code; when you're merely adding columns that don't contribute to primary keys then you shouldn't have to go change any statements other than the ones where you specifically need the new columns. SQL shortcuts like '*' and natural join are just not compatible with such a schema evolution model. Nico -- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users