John Elrick wrote:
> 
> Last rowid.  Rowid will be a key linking to other tables.
> 

What table will rowid be linked to? Are you linking children rows back 
to parent rows?

You should generally use an excplict column as a foreign key (i.e. for 
linking) to other tables. You can use SQLite's "integer primary key" 
optimization which stores a column declared that way as the table's rowid.

> 
> Because they must locate the MAX value which to my mind requires more 
> "work" to be done that a simple:
> 
> select rowid from foo where parent_id = :parentId and child_id = :childId
> 
> and then stepping the first row and discarding the rest...but I could be 
> wrong which is why I was asking<g>
> 

Well if you don't know the max value before hand, then you have to 
search the table to find it before you can use it to get any other 
results. Always assume your table is scrambled to an arbitrary row order 
before each query since SQL works with sets of rows, not ordered tables 
like a spreadsheet.

HTH
Dennis Cote

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to