View Single Post
  #116 (permalink)  
Old 03-01-10, 12:34
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Smile Monday Sudoku

Monday Sudoku <0 sec>:

Code:
select max(sd_id) from final table
(insert into Sd_Source  
select ifnull(max(sd_id), 0) + 1, 1, '309180700'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())       
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 2, '001400306'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 3, '020007009'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all 
select ifnull(max(sd_id), 0) + 1, 4, '000004000'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 5, '007000600'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 6, '000700000'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 7, '800900070'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 8, '403002100'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
union all
select ifnull(max(sd_id), 0) + 1, 9, '000068905'
     , ifnull(max(sd_id), 0) + 1, timestamp(generate_unique())
  from Sd_Source 
);
Quote:
Line 1: | 3 | 6 | 9 | 1 | 8 | 5 | 7 | 2 | 4 |
Line 2: | 7 | 8 | 1 | 4 | 2 | 9 | 3 | 5 | 6 |
Line 3: | 5 | 2 | 4 | 6 | 3 | 7 | 8 | 1 | 9 |
Line 4: | 6 | 1 | 8 | 2 | 9 | 4 | 5 | 3 | 7 |
Line 5: | 2 | 4 | 7 | 8 | 5 | 3 | 6 | 9 | 1 |
Line 6: | 9 | 3 | 5 | 7 | 1 | 6 | 4 | 8 | 2 |
Line 7: | 8 | 5 | 6 | 9 | 4 | 1 | 2 | 7 | 3 |
Line 8: | 4 | 9 | 3 | 5 | 7 | 2 | 1 | 6 | 8 |
Line 9: | 1 | 7 | 2 | 3 | 6 | 8 | 9 | 4 | 5 |
Lenny
Reply With Quote