-
Notifications
You must be signed in to change notification settings - Fork 80
CRUD操作
jaywong edited this page Jul 24, 2013
·
2 revisions
shell操作或者客户端操作。请先移步https://github.com/alibaba/wasp/wiki/%E5%AE%A2%E6%88%B7%E7%AB%AFAPI%EF%BC%9A%E7%AE%A1%E7%90%86%E5%8A%9F%E8%83%BD 查看相关操作教程
INSERT
Insert into User(user_id,name) values(1,'binlijin'); Insert into User(user_id,name) values(2,'lars');
UPDATE
UPDATE User SET name = 'Mike' WHERE user_id = 123;//update只支持主键update条件
DELETE
DELETE FROM User WHERE user_id = 123;//delete只支持主键条件
SELECT
SELECT * from User where user_id=1; //注意:如果用户指定了完整的pk,就不要再指定其他条件,否则会禁止这条访问 SELECT user_id,name from User where user_id=1;//通过主键直接获取某行数据 SELECT user_id,photo_id,full_url,thumbnail_url from Photo where user_id=99999999999 and photo_id=0.1;//这种查询是条件查询,在执行这种查询之前,必须创建一个这种查询模式的索引, //如create index index1 on photo(user_id,photo_id),由于我们的系统是期待多 //维查询的需求都使用索引,所以我们暂时不支持非索引匹配的模式查询数据。