SQLite Select DISTINCT Values of a Column without Ordering

前端 未结 3 1648
执念已碎
执念已碎 2021-02-05 05:03

I would like to know whether its possible to get a list of distinct values in a SQLite Column without ordering them.

I tried following query. But it automatically orders

3条回答
  •  长发绾君心
    2021-02-05 06:09

    What order do you want?

    If you want to get the values in the order of first appearance you can do:

    select distinct column
      from table
     order by min(rowid);
    

提交回复
热议问题