sqlite

sqlite cheat sheet

Tag(s):

# ADD NEW COLUMN

Remove duplicate rows

Tag(s):

DELETE   FROM TableName
WHERE    rowid NOT IN
         (
         SELECT  min(rowid)
         FROM    TableName
         GROUP BY
            column1, 
            column2, 
            columnX
         );

SQLITE connection in java

Tag(s):

package net.xngo.tutorial.java.sqlite;
 
import java.sql.Connection;
import java.sql.DriverManager;

Specify column output witdh

Tag(s):

# Column 1 width set to 6
# Column 2 width set to 155
# Column 3 width set to 25
sqlite3 <sqlite_db_file>.db -cmd ".width 6 155 25" -column -header "SELECT * FROM <tablename>;"
Subscribe to RSS - sqlite