有关数据插入的问题(在线等)
有以下数据表:
color
Color1 Color2 Color3
Red Red Red
red Blue Yellow
white green white
black blue green
上表是COLOR表,每一条纪录有三种颜色,color1,color2,color3组成,例如:(red,red,red).
假设color表中记录的是赛车的配色方案,其中color1, color2, color3分别对应车头,车身和车尾的颜色。现在请你添加一些配色方案记录,要求如下:
1. 不要产生重复记录,也不要和表中原有的记录重复。
2. 根据原有的记录,用车头的颜色刷车身和车尾。例如,原有的车头颜色有red, white, black,则以此产生的新方案有:(red, red, red), (white, white, white), (black, black, black),但是原表中已有(red, red, red)记录,所以只需插入(white, white, white), (black, black, black)。
3. 根据原有的记录,用车身的颜色刷车尾,车头的颜色不变。例如,根据原有记录(white, green, white)产生的新方案为:(white, green, green),该记录原表中没有,所以可以插入。
4.用一条SQL语句完成。
请注意,是一条语句!!!