当前位置: 代码迷 >> ASP.NET >> 小弟我这个sql语句错哪了啊
  详细解决方案

小弟我这个sql语句错哪了啊

热度:2157   发布时间:2013-02-25 00:00:00.0
我这个sql语句哪里错了啊?
SQL code
insert into T_Data select * from(    select SUBSTRING(nm,5,10000)*RAND(),     null,    null,    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    null,    null,    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    null,    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    null,    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    (select SUBSTRING(nm,5,4)*RAND()),    '企业',    'EN',    '',    '',    2007,    1,    (select SUBSTRING(nm,5,4)*RAND()) from T_Enterprise) 


我这里报错:(select SUBSTRING(nm,5,4)*RAND()) from T_Enterprise) “ ')' 附近有语法错误。”

------解决方案--------------------------------------------------------
按你的语句就成了
select * from(A,B,C,D.... from TableB)
------解决方案--------------------------------------------------------
1楼正解。。。
------解决方案--------------------------------------------------------
探讨
SQL code

insert into T_Data select * from(
select SUBSTRING(nm,5,10000)*RAND(),
null,
null,
(select SUBSTRING(nm,5,4)*RAND()),
(select SUBSTRING(nm,5,4)*RAND()),
(select SUB……
  相关解决方案