Access INSERT with nested SELECT

前端 未结 2 663
梦毁少年i
梦毁少年i 2021-01-15 06:02

Why does the following SQL statement not work?

INSERT INTO dialog (speaker, dialog_text) VALUES (
    (
        SELEC         


        
2条回答
  •  爱一瞬间的悲伤
    2021-01-15 06:26

    An Access SQL INSERT ... VALUES statement will not let you use a subquery for one of the VALUES

    Switching to an INSERT ... SELECT statement, as Piotr suggested will work.

    Or you could use an Access Domain Aggregate function, instead of a subquery, in your INSERT ... VALUES statement:

    INSERT INTO dialog (speaker, dialog_text)
    VALUES (
        DMin("id", "FIGURE", "char_name='Doe' AND forename='John'"),
        'Some text'
    );
    

提交回复
热议问题