postgresql and条件与where
子句一起使用,以从表中的多个列中选择唯一的数据。
语法:
select column1, column2, ..... columnn
from table_name
where [search_condition]
and [search_condition];
现在来看看 employees
表中的所有数据 -
下面来查询所有id小于4
并且薪水大于120000
的员工数据信息,执行以下查询语句:
select *
from employees
where salary > 120000
and id <= 4;
执行结果如下 -