SQL insert with function referencing same row
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 )
精彩评论