日期:2014-05-18  浏览次数:20505 次

我这个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……