菜鸟遇到紧急问题求救啊!

rubber365 2003-06-05 12:17:12
我有两个表:
ArtWashPrintSpeci 含有字段(Specification,Price)
ArtWashPrintSpeciInfo 含有字段(ShopName,Specification,Price)

我要向ArtWashPrintSpeciInfo 中插入记录,ShopName和Specification是输入的,而Price要根据Specification从ArtWashPrintSpeci中查出。
如何用一条SQL语句完成这个操作那?
这样,为什么不行呢?
Insert into ArtWashPrintSpeciInfo(UniteShopUserName,Specification,Price) values('aaa','5',(select Price=Price from ArtWashPrintSpeci where Specification='5'))
...全文
31 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
cxingh 2003-06-05
  • 打赏
  • 举报
回复
up
pengdali 2003-06-05
  • 打赏
  • 举报
回复
Insert ArtWashPrintSpeciInfo(UniteShopUserName,Specification,Price)

select 'aaa','5',Price from ArtWashPrintSpeci where Specification='5'
psxfghost 2003-06-05
  • 打赏
  • 举报
回复
Insert into ArtWashPrintSpeciInfo(UniteShopUserName,Specification,Price) (select 'aaa','5' ,Price from ArtWashPrintSpeci where Specification='5'))
愉快的登山者 2003-06-05
  • 打赏
  • 举报
回复
Insert into ArtWashPrintSpeciInfo
select 'aaa','5', Price from ArtWashPrintSpeci where Specification='5'
lqxmm 2003-06-05
  • 打赏
  • 举报
回复
Insert into ArtWashPrintSpeciInfo select 'aaa' as UniteShopUserName,'5' as Specification,Price from ArtWashPrintSpeci where Specification='5'
就可以了
messinglong 2003-06-05
  • 打赏
  • 举报
回复
up

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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