View Single Post
  #107 (permalink)  
Old 01-19-10, 16:43
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Smile "AMNY" - level-4 Sudoku

"AMNY" - level-4 Sudoku > 5 sec <

Code:
select max(sd_id) from final table
(insert into Sd_Source  
select ifnull(max(sd_id), 0) + 1, 1, '000076040' 
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())       
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 2, '007000100'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 3, '054900870'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all 
select ifnull(max(sd_id), 0) + 1, 4, '000600002'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 5, '000000010'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 6, '200004000'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 7, '072001380'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 8, '001080900'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 9, '060790000' 
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
);
Quote:
Line 1: | 1 | 8 | 9 | 5 | 7 | 6 | 2 | 4 | 3 |
Line 2: | 6 | 2 | 7 | 3 | 4 | 8 | 1 | 5 | 9 |
Line 3: | 3 | 5 | 4 | 9 | 1 | 2 | 8 | 7 | 6 |
Line 4: | 4 | 1 | 8 | 6 | 3 | 7 | 5 | 9 | 2 |
Line 5: | 7 | 3 | 5 | 8 | 2 | 9 | 6 | 1 | 4 |
Line 6: | 2 | 9 | 6 | 1 | 5 | 4 | 7 | 3 | 8 |
Line 7: | 9 | 7 | 2 | 4 | 6 | 1 | 3 | 8 | 5 |
Line 8: | 5 | 4 | 1 | 2 | 8 | 3 | 9 | 6 | 7 |
Line 9: | 8 | 6 | 3 | 7 | 9 | 5 | 4 | 2 | 1 |
Lenny
Reply With Quote