View Single Post
  #106 (permalink)  
Old 01-15-10, 11:17
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Post Post Sudoku

NY Post Sudoku Difficult #1400 << 1 sec >>

Code:
select max(sd_id) from final table
(insert into Sd_Source  
select ifnull(max(sd_id), 0) + 1, 1, '000000000' 
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())       
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 2, '204705308'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 3, '060308010'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all 
select ifnull(max(sd_id), 0) + 1, 4, '003000500'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 5, '950000036'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 6, '006000700'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 7, '080103050'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 8, '407809601'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 9, '000000000' 
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
);
Quote:
Line 1: | 3 | 1 | 8 | 2 | 4 | 6 | 9 | 7 | 5 |
Line 2: | 2 | 9 | 4 | 7 | 1 | 5 | 3 | 6 | 8 |
Line 3: | 7 | 6 | 5 | 3 | 9 | 8 | 2 | 1 | 4 |
Line 4: | 8 | 7 | 3 | 9 | 6 | 1 | 5 | 4 | 2 |
Line 5: | 9 | 5 | 2 | 4 | 8 | 7 | 1 | 3 | 6 |
Line 6: | 1 | 4 | 6 | 5 | 3 | 2 | 7 | 8 | 9 |
Line 7: | 6 | 8 | 9 | 1 | 2 | 3 | 4 | 5 | 7 |
Line 8: | 4 | 3 | 7 | 8 | 5 | 9 | 6 | 2 | 1 |
Line 9: | 5 | 2 | 1 | 6 | 7 | 4 | 8 | 9 | 3 |
Lenny
Reply With Quote