Skip to content Skip to sidebar Skip to footer

A Derived Field In An Sqlite3 Database

Good Evening everyone, Today I would like to ask a question relating to derived fields (also known as calculation fields) in SQLite3. Utilizing two values stored within my database

Solution 1:

You can achieve this goal using a VIEW:

CREATEVIEW MyTablePlus (Weight, Distance, CaloriesBurned) ASSELECT Weight, Distance, ((Weight / Distance) * SomeNumber)
   FROM MyTable

Now, you can performs your SELECT statements on MyTablePlus and your INSERT and UPDATE statements on MyTable.

Post a Comment for "A Derived Field In An Sqlite3 Database"