Can you use something along the lines of this? insert into max_value select value as "value" from source_table order by value desc limit 1;
Shane Dev Sent: Wednesday, January 10, 2018 11:49 AM To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Subject: [sqlite] Is it possible to conditionally insert a record? Hello, sqlite> create table source_table(value); sqlite> create table max_value(max_value); sqlite> insert into max_value select max(value) from source_table; sqlite> select * from table_max_value; max_value sqlite> How can the maximum value of column source_table.value be inserted into max_value only if there are records in source_table? (If source_table is empty, nothing should be inserted into max_value, not even a NULL) ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users