insert into color select color1,color1,color1 from color where color1 not in (select color1 from color)insert into color select color1,color2,color2 from color where color2 not in (select color2 from color)

解决方案 »

  1.   

    sorry:
    insert into color 
    select color1,color1,color1 
    from color 
    where color1<>color2 insert into color 
    select color1,color2,color2 
    from color 
    where color2<>color3
      

  2.   

    insert into color 
    select color1, color1, color1 from color 
    where color1 not in (select color2 from color ) 
    union select color1, color2, color2 from color
    where color2 not in (select color3 from color)
      

  3.   

    color1     color2     color3     
    ---------- ---------- ---------- 
    Red        Red        Red       
    red        Blue       Yellow    
    white      green      white     
    black      blue       green     
    black      black      black     
    black      blue       blue      
    red        Blue       Blue      
    white      white      white     
      

  4.   

    2、 对于某一种颜色,它存在于color2中,而不在color3中,则再创建一条或多条新纪录,其中color2,color3均为该颜色,而color1为原来color2所对应的颜色,例如:(red,blue,blue)和(black,blue,blue)我的理解:只要Color2 和Color3 不同,则增加记录Color2 ,Color3 是该颜色就是Color2 的颜色。 Color 1 也是Color2 的颜色,就是三个都变为一种颜色了?
      

  5.   

    小马哥,
    怎么都是
    select color1,color1,colo1 .....呀
    是不是写错了呀
    应该是
    select color1,color2,color3....呀
      

  6.   

    怎么又来了 这两天都回答了3次了 
    To  aht1979(蓝色雪狐)你是哪里看来的题目阿
      

  7.   

    TO happydreamer
    一家公司给的
    既然你知道,就麻烦你指点指点了