How can I insert values into a table, using a subquery with more than one result?

前端 未结 6 966
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 05:26

I really would appreciate your help.

Probably it\'s a quite simple problem to solve - but I\'m not the one .. ;-)

I have two tables in SQL Server:

6条回答
  •  天涯浪人
    2020-11-28 05:56

    Try this:

    INSERT INTO prices (
        group, 
        id,
        price
    ) 
    SELECT
        7,
        articleId,
        1.50
    FROM
        article 
    WHERE 
        name LIKE 'ABC%';
    

提交回复
热议问题