开发者

SQL insert with function referencing same row

开发者 https://www.devze.com 2023-04-04 20:16 出处:网络
Can I do something like this is SQL? INSERT INTO table (a, b) VALUES (\'qwerty\', upper(a)); I want 开发者_如何学Pythonthe result to be a row with a: qwerty and b: QWERTY. This exact example doesn\

Can I do something like this is SQL?

INSERT INTO table (a, b) VALUES ('qwerty', upper(a));

I want 开发者_如何学Pythonthe result to be a row with a: qwerty and b: QWERTY. This exact example doesn't work, but can I do it a different way?

Please do not tell me to just calculate it on my own. The above is just a simplified example. The actual use is a very complex function that is implemented as a function in SQL.

If it makes a difference, I am using SQLite.


 INSERT INTO the_table
 SELECT a, upper(a) FROM
 ( SELECT 'qwerty' a )
0

精彩评论

暂无评论...
验证码 换一张
取 消