On 7/24/06, hanno <[EMAIL PROTECTED]> wrote:
Hello Jay! My example schema describes positions on a chessboard. I am aiming to make the neighbourhood relation explicit. From the line/row sorted view I want to associate to each entry the predecessors row value as northern bound of horizon and the successors as the southern bound. I'd like to do so for all axis of the board. If the problem is solved for the vertical axis, it can be solved for each other axis with appropriately sorted versions of extended_position. - So how can I get the row value of the predecessor/successor, if there is one in the same line, or just the information that there is no p/s with the same line value. Given that case, I know that the same game starts again.
A unique id column on the table will uniquely identify each row and it works in views as well. There's also the ROWID column, which is implicit in select statements: sqlite> .schema one CREATE TABLE one ( Id INTEGER PRIMARY KEY, test1 TEXT NOT NULL ); sqlite> sqlite> select rowid, * from one where id > 10 limit 10; 11|11|test 12|12|test 13|13|test 14|14|test 15|15|test 16|16|test 17|17|test 18|18|test 19|19|test 20|20|test sqlite> I'm not sure that will help you though. When you execute this does it return the predecessor row and you just need to sort it? Or do you have to execute another query to find the predecssor? If so, just return the unique id and then it's identified by (id-1)