lovinglinux
November 25th, 2008, 10:19 AM
I need some help with sqlite3 syntax.
I'm writing a few shell scripts integrated with a sqlite database. I need to get the values from a column and copy to another column in the same entry. Is it possible?
For example:
sqlite3 ~/mydatabase.sqlite "update mytable set column_to_be_updated='????' where filtered_column='${VARIABLE}'"
What I want is to get the "????" value from another column without using a variable.
If this is not possible, how could I retrieve data for each entry row separately? I have multiple entries with the same filtered ${VARIABLE}, so when I replace ???? with another variable, it grabs the column value from all entries.
I'm writing a few shell scripts integrated with a sqlite database. I need to get the values from a column and copy to another column in the same entry. Is it possible?
For example:
sqlite3 ~/mydatabase.sqlite "update mytable set column_to_be_updated='????' where filtered_column='${VARIABLE}'"
What I want is to get the "????" value from another column without using a variable.
If this is not possible, how could I retrieve data for each entry row separately? I have multiple entries with the same filtered ${VARIABLE}, so when I replace ???? with another variable, it grabs the column value from all entries.