Difference between revisions of "sqlite3 notes"

From thelinuxwiki
Jump to: navigation, search
 
Line 11: Line 11:
 
  0    main            c:\sqlite\db\chinook.db
 
  0    main            c:\sqlite\db\chinook.db
 
  2    contacts        c:\sqlite\db\contacts.db
 
  2    contacts        c:\sqlite\db\contacts.db
 +
 +
==copying data==
 +
===between columns===
 +
===between tables===
 +
===between databases===
  
 
==usefull techniques==
 
==usefull techniques==

Latest revision as of 17:27, 23 May 2019

Contents

basics

attaching secondary databases

to insert, query, etc. between tables on different databases, attach multiple to your session

sqlite> ATTACH DATABASE file_name AS database_name;

list attached databases

sqlite> .databases
seq  name             file
---  ---------------  ----------------------------------------------------------
0    main             c:\sqlite\db\chinook.db
2    contacts         c:\sqlite\db\contacts.db

copying data

between columns

between tables

between databases

usefull techniques

helps you prevent an error of creating something that already exists

IF NOT EXISTS

How to combine rows based on duplicate data in Sqlite

combine rows android