View Single Post
  #115 (permalink)  
Old 02-24-10, 16:52
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Talking Level 3 Sudoku

Sudoku as Sudoku. Level 3. > 0 sec <

Code:
select max(sd_id) from final table
(insert into Sd_Source  
select ifnull(max(sd_id), 0) + 1, 1, '000190600'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())       
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 2, '800005000'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 3, '400080701'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all 
select ifnull(max(sd_id), 0) + 1, 4, '640000830'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 5, '000809000'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 6, '008000016'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 7, '306040002'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 8, '000200007'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 9, '009038000'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
);
Quote:
Line 1: | 2 | 5 | 7 | 1 | 9 | 3 | 6 | 4 | 8 |
Line 2: | 8 | 6 | 1 | 4 | 7 | 5 | 9 | 2 | 3 |
Line 3: | 4 | 9 | 3 | 6 | 8 | 2 | 7 | 5 | 1 |
Line 4: | 6 | 4 | 5 | 7 | 2 | 1 | 8 | 3 | 9 |
Line 5: | 1 | 3 | 2 | 8 | 6 | 9 | 4 | 7 | 5 |
Line 6: | 9 | 7 | 8 | 3 | 5 | 4 | 2 | 1 | 6 |
Line 7: | 3 | 1 | 6 | 9 | 4 | 7 | 5 | 8 | 2 |
Line 8: | 5 | 8 | 4 | 2 | 1 | 6 | 3 | 9 | 7 |
Line 9: | 7 | 2 | 9 | 5 | 3 | 8 | 1 | 6 | 4 |
Lenny
Reply With Quote