On Tue, Feb 28, 2017 at 5:40 PM, <do...@mail.com> wrote: > # SELECT * FROM processors UNION SELECT * FROM storage; > Error: SELECTs to the left and right do not have the same number of > result columns. > > All tables that I created in my database have differing column names, > values, and amounts of columns with the noted exception of the one > column which is common (board). I've no idea what to do now. > > Why is this an error? >
1 6770 2 3770 1 samsung 960 250G 2 seagate 5T 3 what should it use for fields, if the query first encounters 2 columns, and starts allocating rows for it, then runs into data with 3, then it shouln't just drop some arbitrary data, so it throws an error. If you want them really to merge... on the first select *,"nothing" from X untion select * from Y (I think sqlite allows * as first or last argument) or sepcifically name some number from X and the same number from Y and it'll put them together.... Whether that actually has any meaning is up to the application.... > > Thank you, > David > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users