Any time when you add the new sudoku puzzle to the Sd_Source table
you have to use following query, or any query which
you want to use for insert start numbers of your Sudoku puzzle.
After insertion into the table performed, you can run
select sudoku_solution from SDVW_SOLUTION view.
*/
select max(sd_id) from final table (insert into Sd_Source select ifnull(max(sd_id), 0) + 1, 1, '007206800' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source union all select ifnull(max(sd_id), 0) + 1, 2, '006500010' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source union all select ifnull(max(sd_id), 0) + 1, 3, '803000000' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source union all select ifnull(max(sd_id), 0) + 1, 4, '000060350' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source union all select ifnull(max(sd_id), 0) + 1, 5, '070000080' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source union all select ifnull(max(sd_id), 0) + 1, 6, '052000000' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source union all select ifnull(max(sd_id), 0) + 1, 7, '000000703' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source union all select ifnull(max(sd_id), 0) + 1, 8, '960003100' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source union all select ifnull(max(sd_id), 0) + 1, 9, '005401900' , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique()) from Sd_Source ); select sudoku_solution from SDVW_SOLUTION;
Result:
Line 1: | 5 | 1 | 7 | 2 | 9 | 6 | 8 | 3 | 4 |
Line 2: | 4 | 9 | 6 | 5 | 3 | 8 | 2 | 1 | 7 |
Line 3: | 8 | 2 | 3 | 1 | 4 | 7 | 5 | 9 | 6 |
Line 4: | 1 | 4 | 8 | 7 | 6 | 2 | 3 | 5 | 9 |
Line 5: | 6 | 7 | 9 | 3 | 1 | 5 | 4 | 8 | 2 |
Line 6: | 3 | 5 | 2 | 9 | 8 | 4 | 6 | 7 | 1 |
Line 7: | 2 | 8 | 1 | 6 | 5 | 9 | 7 | 4 | 3 |
Line 8: | 9 | 6 | 4 | 8 | 7 | 3 | 1 | 2 | 5 |
Line 9: | 7 | 3 | 5 | 4 | 2 | 1 | 9 | 6 | 8 |
Lenny