On 22 Dec 2016, at 5:55pm, Adrian Stachlewski <[email protected]> wrote:
> In this case I think that the best way to do this is cast integer column to > text. > CREATE VIEW id_map(id, name) as > SELECT CAST(id AS TEXT), name > FROM map_integer > UNION ALL > SELECT id, name > FROM map_text; In an earlier post > CREATE TABLE map_integer (id INTEGER PRIMARY KEY, name TEXT); > CREATE TABLE data (id TEXT PRIMARY KEY, flag BOOLEAN); Your problem is not the form of your enquiry, or the precise way that UNION works, it’s the data you’re storing. Sorry if you’ve already explained this, but can you tell me why you have an id field which holds numbers defined as TEXT in one table, but an id field which holds numbers defined as INTEGER in another table ? I know that the above schema is an example you made up for discussing the problem, and not your real schema, but it still points to an underlying problem with the data you’re storing. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

