[sqlite] Select top 1 from duplicate values

2016-02-22 Thread Quan Yong Zhai
sqlite> create table mytable(f1 integer,f2 integer,f3 integer); sqlite> insert into mytable values(1,2,8),(1,3,9),(2,4,8),(2,5,2),(3,6,4),(3,7,8),(4,2,4); sqlite> select f1, max(f2), f3 from mytable where (f3&8)!=0 group by f1; 1|3|9 2|4|8 3|7|8 sqlite>

[sqlite] Select top 1 from duplicate values

2016-02-22 Thread ad...@shuling.net
Hi, I am using SQLite 3.11. I create a table as follows: CREATE TABLE MyTable (F1 INTEGER, F2 INTEGER, F3 INTEGER); Then add the following records: INSERT INTO MyTable (F1, F2, F3) Values (1, 2, 8);

[sqlite] Select top 1 from duplicate values

2016-02-21 Thread Keith Medcalf
o:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of admin at shuling.net > Sent: Sunday, 21 February, 2016 19:43 > To: sqlite-users at mailinglists.sqlite.org > Subject: [sqlite] Select top 1 from duplicate values > Importance: High > Sensitivity: Confidential > > Hi, &