On 10 Nov 2013, at 4:26pm, Igor Korot <ikoro...@gmail.com> wrote: > I'm updating the table when the program exit.
There is not need to update the table. In fact there's no need to store the rank values at all. > Now, I would expect for the max() function in this case to be > evaluated to 0 and not NULL. > This is plain mathematics: max value of nothing is nothing which > mathematically 0. No. Max of nothing is nothing. And the way you express 'nothing' in SQL is NULL. NULL is not 0 or 0.0. NULL is not the empty string "". NULL is not the BLOB x''. NULL means 'value missing'. As another contributor to the thread noted, suppose you have a list of any number of values. You remove them one by one. At each stage, the maximum of the remaining list can only remain the same or get smaller. Why should removing the last number somehow /increase/ the maximum of a list ? Now suppose your list is -18, -41, -23 and you remove them in any order. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users