首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

这样一个SQL语言有其他写法吗?该怎么解决

2012-03-25 
这样一个SQL语言有其他写法吗?insertintousefulselect*fromrecordwherenamein(selectnamefromrecordwherea

这样一个SQL语言有其他写法吗?
insert   into   useful
select   *   from   record
where   name   in   (select   name   from   record   where   address= '10.20.126.65 '   group   by   name,admin,sex)
    and   admin   in   (select   admin   from   record   where   address= '10.20.126.65 '   group   by   name,admin,sex)
    and   sex   in   (select   sex   from   record   where   address= '10.20.126.65 '   group   by   name,admin,sex);


[解决办法]
insert into useful
select * from record
where name+admin+sex in (select name+admin+sex from record where address= '10.20.126.65 ' group by name,admin,sex)

热点排行