[sqlite] Re: bug in SELECT DISTINCT ?

2005-09-17 Thread Igor Tandetnik

Miha Vrhovnik wrote:

So How can I select DISTINCT ON 1st column OR any other.
as sqlite does not support DISTINCT ON (column1, column2, )


What does it mean to select distinct on one column only? If you have a
table with two rows

1,1
1,2

and you want to select distinct on the first column, which one would you
want? How is the engine supposed to decide?

Igor Tandetnik 



[sqlite] Re: bug in SELECT DISTINCT ?

2005-09-17 Thread Miha Vrhovnik
"Igor Tandetnik" <[EMAIL PROTECTED]> je ob 17.9.2005 16:20:03 napisal(a):

>Why did you expect the latter? DISTINCT in SELECT DISTINCT detects
>identical rows, not identical first columns. The three first rows with
>an id of 1 differ in the columns you chose not to show (specifically in
>the map.d0 column), that's why all three are returned.
>
>The second query is equivalent to
>
>SELECT * FROM t1, map WHERE t1.id = map.idT1 AND id IN (1, 2, 3);
>
>Of course it returns all rows.
>

So How can I select DISTINCT ON 1st column OR any other.
as sqlite does not support DISTINCT ON (column1, column2, )

Regards,
Miha