首先复习创建学生表Students。
---注意表名大小写问题 CREATE TABLE public."Students"( "StudentID" INTEGER PRIMARY KEY,"StudentName" TEXT NOT NULL,"StudentBirthday" DATE,"StudentAddress" VARCHAR(50),"StudentSalary" REAL );
先在表内插入2条数据。
INSERT INTO public."Students"("StudentID","StudentName","StudentBirthday","StudentAddress","StudentSalary") VALUES ('1','贾明','1988-18-18','江苏省南京市鼓楼区','200'), ('2','贾宝玉','1988-9-9','300'),('3','甄宝玉','1988-8-8','200');
更新StudentID=2行StudentBirthday=1988-9-9数据。
UPDATE public."Students" SET "StudentBirthday"='1988-9-9' WHERE "StudentID"=2;
再次练习插入一次修改多个值。
UPDATE public."Students" SET "StudentBirthday"='1988-8-8',"StudentSalary"=300 WHERE "StudentID"=1;原文链接:https://www.f2er.com/postgresql/193523.html