如何在postgres里使用distinct去重复
1、打开命令行窗口,sudo su postgres进入数据库。

2、\c test进入test数据库。

4、SELECT DISTINCT country_of_birth FROM person;这样我们提取的时候就能够去掉重复的数据。

5、SELECT DISTINCT country_of_birth FRO怡觎现喾M personORDER BY country_of_birth ASC;我们还可以进行去重后的排序。

6、SELECT DISTINCT country_of_birth FRO怡觎现喾M personORDER BY country_of_birth DESC;降序也是可以的。

7、SELECT DISTINCT country_of_birth, gender FROM person;我们可以对两个列同时去重,但是只会去重前面的那个。

8、不能同时用两个DISTINCT。

