先复习插入数据。
INSERT INTO "Students" VALUES (6,'黄飞鸿',NULL,'广东省佛山市',2); INSERT INTO "Students" VALUES (7,'黄帝','陕西省延安市',0); INSERT INTO "Students" VALUES (8,'郭嘉','0173-2-3',2);
查询现有数据。
select * from public."Students";
接下来练习逻辑和(AND)。
#查询出生日期大于1999-1-1且学费大于与等于50数据 select * from public."Students" where "StudentBirthday">'1990-1-1' and "StudentSalary">=50;
#插入两条数据 INSERT INTO "public"."Students"("StudentID","StudentName","StudentBirthday","StudentAddress") VALUES(9,'杜甫','0712-1-1','河南省'),(10,'白居易','0772-1-1','河南省新郑市');
练习逻辑与(OR)。
#练习逻辑与 SELECT * FROM "public"."Students" WHERE "StudentBirthday"<'1990-1-1' OR "StudentAddress"='河南省';原文链接:https://www.f2er.com/postgresql/193512.html