Search code examples
sqlsqlitesqlitemanager

How to reorder table columns in a SQLITE Database?


I have a table with two columns that I'd like to swap. I want the column with index 5 to be swapped with the column with index 4. This post from 2013 suggests this might not be possible. Is there a way to do this now?

I am currently using SQLite Manager plugin for Firefox.


Solution

  • you can do it but with the using of creating new table from existing table.

    step 1 SELECT col1,col2,col3,col5,col4 INTO #tab1 FROM tab

    step 2 rename the table tab to tab2

    step 3 rename tab1 to tab

    this process might help you.

    but if you move column in existing table there is possibility to corrupt the data.