请问这样插入数据有什么问题啊

ivy_ou 2003-08-20 07:08:48
insert into boardmaster (boardid,userid)values(select a.boardid,b.id from board a,[user] b where b.username=a.boardmaster and a.boardmaster is not null)
提示错误
服务器: 消息 156,级别 15,状态 1,行 1
在关键字 'select' 附近有语法错误。
服务器: 消息 170,级别 15,状态 1,行 1
第 1 行: ')' 附近有语法错误。
...全文
65 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
guxiaobo1982 2003-08-20
  • 打赏
  • 举报
回复
还要注意你的boardmaster 表的一些字段是允许空的,否则有一致性错误的.
lynx1111 2003-08-20
  • 打赏
  • 举报
回复
yes!
hjb111 2003-08-20
  • 打赏
  • 举报
回复
你的意思我明白:
可以这样做:
insert into boardmaster (boardid,userid) select a.boardid,b.id from board a,[user] b where b.username=a.boardmaster and a.boardmaster is not null
caiyunxia 2003-08-20
  • 打赏
  • 举报
回复
value不能有SELECT
只能用常量或变量

34,588

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧