View Single Post
  #114 (permalink)  
Old 02-19-10, 17:10
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Cool Friday Sudoku (HARD)

Friday Sudoku (HARD) < 1 sec >:

Code:
select max(sd_id) from final table
(insert into Sd_Source  
select ifnull(max(sd_id), 0) + 1, 1, '360002405'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())       
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 2, '070050000'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 3, '905060300'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all 
select ifnull(max(sd_id), 0) + 1, 4, '080906100'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 5, '000000000'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 6, '007405020'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 7, '009080703'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 8, '000040080'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 9, '804700096'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
);
Quote:
Line 1: | 3 | 6 | 8 | 1 | 9 | 2 | 4 | 7 | 5 |
Line 2: | 2 | 7 | 1 | 3 | 5 | 4 | 8 | 6 | 9 |
Line 3: | 9 | 4 | 5 | 8 | 6 | 7 | 3 | 1 | 2 |
Line 4: | 5 | 8 | 2 | 9 | 7 | 6 | 1 | 3 | 4 |
Line 5: | 4 | 3 | 6 | 2 | 1 | 8 | 9 | 5 | 7 |
Line 6: | 1 | 9 | 7 | 4 | 3 | 5 | 6 | 2 | 8 |
Line 7: | 6 | 2 | 9 | 5 | 8 | 1 | 7 | 4 | 3 |
Line 8: | 7 | 5 | 3 | 6 | 4 | 9 | 2 | 8 | 1 |
Line 9: | 8 | 1 | 4 | 7 | 2 | 3 | 5 | 9 | 6 |
Lenny
Reply With Quote