insert into 你的表(userid)
select userid from user 

解决方案 »

  1.   

    如果新表不存在,可用:
    select userid 
    into 新表
    from user 
      

  2.   

    --插入现有表
    insert 表(userid) select userid from user --结果生成新表
    select userid into 新表 from user 
      

  3.   

    --最好括一下--插入现有表
    insert 表(userid) select userid from [user]--结果生成新表
    select userid into 新表 from [user]
      

  4.   

    select userid 
    into 新表
    from user
      

  5.   

    insert into userinfo (userID,logintime) values (userID,getDate()) Select BarID  From BarInfo where userOnline=1
    怎么不行啊
    服务器: 消息 128,级别 15,状态 1,行 1
    在此上下文中不允许使用 'BarID'。此处只允许使用常量、表达式或变量。不允许使用列名。
      

  6.   

    --你写错了,没有values这样用的,改成这样就可以了:insert into userinfo (userID,logintime)
    Select BarID,getdate() From BarInfo where userOnline=1
      

  7.   

    insert into userinfo (userID,logintime) 
    Select BarID,时间字段  From BarInfo where userOnline=1