Skip to content

Instantly share code, notes, and snippets.

@marshluca
Created January 5, 2011 15:33
Show Gist options
  • Save marshluca/766460 to your computer and use it in GitHub Desktop.
Save marshluca/766460 to your computer and use it in GitHub Desktop.
select * from sqlite_master where type='index';
drop index vegetables_name;
create index vegetables_name on vegetables(name);
insert into vegetables values ("luobo", "green", "nice luobo");
create table vegetables (name char not null, color char not null default 'green', description char);
drop table vegetables;
attach database demodb as demodb;
select color , count(*) as num_color from vegetables group by color having num_color > 0;
select vegetables.color , compare.number from vegetables, compare;
select datetime('now','localtime')
select time('now', 'localtime');
sqlite3 test.db "create table t1 (t1key INTEGER
PRIMARY KEY,data TEXT,num double,timeEnter DATE);"
sqlite3 test.db "select * from t1 order by t1key limit 1 offset 2";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment