New answers tagged sqlite
Question was ultimately answered on superuser. The solution is to compile sqlite3 with readline support.
As you have seen, a simple GROUP BY will not work because it would return only one record per group. Your join works fine. For a large table, it will be efficient only if there is an index on the join columns (num and text). Alternatively, you could use a correlated subquery: SELECT * FROM t WHERE num = (SELECT MIN(num) FROM t AS t2 ...
Shouldn't be this query exactly what you need? select min(num), text, num2 group by text, num2
Top 50 recent answers are included