1

挿入に複数の選択ステートメントまたは値を含めることができる必要があります。2 番目の列名 (notication_timestamp) を削除すると、次のように機能します。

insert into notification (msg,notification_timestamp) select msg from data;

言えるようになりたい:

insert into notification (msg,notification_timestamp) values (select msg from data,now());

しかし、それはうまくいきません。何か案は?

4

2 に答える 2

5

値ステートメントを削除します。

Insert into notification(msg, notification_timestamp)
    Select msg, now()
    from data
于 2012-05-13T03:51:06.133 に答える
2

notification_timestamp選択クエリを実行しませんでした

insert into notification (msg,notification_timestamp) select msg,'value for notification_timestamp' from data;

そうかもしれません

insert into notification (msg,notification_timestamp) select msg,now() from data;
于 2012-05-13T03:49:57.660 に答える