SQLite – Does COLLATE Preserve on Tables in a View?

collationsqlite

In sqlite3 collations are defined per-column. If you CREATE TEMPORARY TABLE foo AS SELECT ... the resulting temporary table foo does not inherit any custom collations from the columns in the SELECT. What happens if you CREATE VIEW foo AS SELECT ...? Does the view "table" keep column collations or lose them?

Best Answer

In sqlite3 VIEWs keep the column collation from the underlying table. Proof: http://sqlfiddle.com/#!5/52669/3