SQLite Reorder Table? -


can reorder sqlite table columns via query?

i prefer query method, if not possible there other way?

yes, control order of columns order name them in query. both these queries return same rows, columns in different order.

select first_column_name, second_column_name mytable;  select second_column_name,  first_column_name mytable; 

if want appear columns in base table have been permanently changed, can use view.

create view mytable_reordered select second_column_name,  first_column_name mytable; 

if wanted make change transparent application programs, you'd first rename table, create view, giving old name of table. finally, you'd jump through whatever hoops dbms requires in order make view updatable. in sqlite, think means writing code implement instead of triggers.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -