Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created January 3, 2012 03:37
Show Gist options
  • Save mwotton/1553354 to your computer and use it in GitHub Desktop.
Save mwotton/1553354 to your computer and use it in GitHub Desktop.
sqlite> SELECT * FROM blocks;
id|name|guid|last_ip|created_at|updated_at|pubkey|user_id
34|||127.0.0.1|2012-01-02 08:17:14.595101|2012-01-02 08:17:14.595101|foobar|
sqlite> select * from blocks where last_ip='127.0.0.1';
sqlite> select * from blocks where pubkey='foobar';
id|name|guid|last_ip|created_at|updated_at|pubkey|user_id
34|||127.0.0.1|2012-01-02 08:17:14.595101|2012-01-02 08:17:14.595101|foobar|
and
sqlite> select * from blocks;
id|name|guid|last_ip|created_at|updated_at|pubkey|user_id
34|||127.0.0.1|2012-01-02 08:17:14.595101|2012-01-02 08:17:14.595101|333|
35|||127.0.0.1|2012-01-03 03:36:04.483322|2012-01-03 03:36:04.483322|foobar|
sqlite> select * from blocks where last_ip='127.0.0.1';
id|name|guid|last_ip|created_at|updated_at|pubkey|user_id
34|||127.0.0.1|2012-01-02 08:17:14.595101|2012-01-02 08:17:14.595101|333|
sqlite> select last_ip from blocks;
last_ip
127.0.0.1
127.0.0.1
sqlite> select distinct last_ip from blocks;
last_ip
127.0.0.1
127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment