code_junkie

How do I find out if a SQLite index is unique? (With SQL)

Nov 11th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. SELECT * FROM sqlite_master WHERE name = 'sqlite_autoindex_user_1'
  2.  
  3. PRAGMA index_info(sqlite_autoindex_user_1);
  4.  
  5. PRAGMA INDEX_LIST('table_name');
  6.  
  7. select count(*) from t
  8. group by foo, bar, baz
  9. having count(*) > 1
  10.  
  11. select count(*) from (
  12. select count(*) from t
  13. group by foo, bar, baz
  14. having count(*) > 1
  15. )
Add Comment
Please, Sign In to add comment