hi

C:\!dc-db\db-sqlite-corrupt\db-uniq-bug>sqlite3 --version
3.8.5 2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212


C:\!dc-db\db-sqlite-corrupt\db-uniq-bug>sqlite3.exe FlylinkDC.sqlite
0<test-uniq-3.sql
CREATE TABLE fly_hash_block(tth_id integer PRIMARY KEY NOT NULL, tth number
NOT NULL);
INSERT INTO fly_hash_block VALUES(1,1);
INSERT INTO fly_hash_block VALUES(2,2);
INSERT INTO fly_hash_block VALUES(3,2);
*CREATE UNIQUE INDEX iu_fly_hash_block_tth ON fly_hash_block(tth);*
select * from fly_hash_block;
1|1
2|2
3|2
select *distinct* tth from fly_hash_block;
1

*22*
select tth,count(*) from fly_hash_block group by tth;
1|1
2|2


p.s. Oracle  - All OK

SQL>
SQL> CREATE TABLE fly_hash_block(tth_id integer PRIMARY KEY NOT NULL, tth
number NOT NULL);
Table created
SQL> INSERT INTO fly_hash_block VALUES(1,1);
1 row inserted
SQL> INSERT INTO fly_hash_block VALUES(2,2);
1 row inserted
SQL> INSERT INTO fly_hash_block VALUES(3,2);
1 row inserted
SQL> CREATE UNIQUE INDEX iu_fly_hash_block_tth ON fly_hash_block(tth);
CREATE UNIQUE INDEX iu_fly_hash_block_tth ON fly_hash_block(tth)
*ORA-01452: CREATE UNIQUE INDEX невозможно; найдены дублирующиеся ключи*
SQL> select * from fly_hash_block;
                                 TTH_ID        TTH
--------------------------------------- ----------
                                      1          1
                                      2          2
                                      3          2
SQL> select distinct tth from fly_hash_block;
       TTH
----------
         1
*         2*
SQL> select tth,count(*) from fly_hash_block group by tth;
       TTH   COUNT(*)
---------- ----------
         1          1
         2          2


-- 
~PPA() {} //
http://flylinkdc.blogspot.com/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to