如何在postgres里使用where排除条件

2025-10-31 11:58:56

1、sudo su postgres

进入postgres。

如何在postgres里使用where排除条件

2、\c test

\dt

连接数据库。

如何在postgres里使用where排除条件

3、SELECT * FROM person;

选取数据查看一下所有数据。

如何在postgres里使用where排除条件

如何在postgres里使用where排除条件

4、SELECT * FROM person;

WHERE gender = "Male";

根据条件可以筛选数据。

如何在postgres里使用where排除条件

如何在postgres里使用where排除条件

5、SELECT * FROM person;

WHERE gender = "Male" AND country_of_birth = "China";

WHERE还可以和AND配合。

如何在postgres里使用where排除条件

如何在postgres里使用where排除条件

6、还可以用括号选定多个数据判断。

如何在postgres里使用where排除条件

如何在postgres里使用where排除条件

7、即使是多个数据也是没问题的。

如何在postgres里使用where排除条件

如何在postgres里使用where排除条件

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢