原料:数据表
create table "SysUser"( "UserId" serial, --用户Id,自增 "UserName" character varying(50), --用户名 "Pwd" character varying(50), --密码 "Status" smallint, --状态 primary key("UserId") --设置UserId主键 )
1.添加数据
语法:insert into table (column1, column2, column3,...columnN) values (value1, value2, value3,...valueN)
insert into "SysUser"("UserName","Pwd")values('username1','123456'); insert into "SysUser"("UserName","Pwd")values('username2','123456'); insert into "SysUser"("UserName","Pwd")values('username3','123456'); insert into "SysUser"("UserName","Pwd")values('username4','123456');
数据输出
2.修改数据
语法:update table set column1 = value1, column2 = value2...., columnN = valueN where [condition]
update "SysUser" set "Status"=1 where "UserId"=3;
数据输出
3.删除数据
语法:delete from table where [condition];
delete from "SysUser" where "UserId"=3;
数据输出