orient中sql命令
SELECT
1、基本查询
orientdb> SELECT FROM OUser
2、根据Clusters查询
orientdb> SELECT FROM CLUSTER:Ouser
3、根据Record ID查询,需要先进行基本查询
orientdb> SELECT FROM
orientdb> SELECT FROM [
4、根据Indexes查询,主要查询dictionary(鸡肋)
orientdb> SELECT VALUE FROM INDEX :dictionary WHERE key = 'Jay'
WHERE
1、
orientdb> SELECT FROM OUser WHERE name LIKE 'l%'
ORDER BY
1、排序
orientdb> SELECT FROM Employee WHERE city= 'Rome' ORDER BY surname ASC , name ASC
GROUP BY
1、分组
orientdb> SELECT SUM ( salary) FROM Employee WHERE age < 40 GROUP BY job
LIMIT
1、分页
orientdb> SELECT FROM Employee WHERE gender= 'male' LIMIT 20
SKIP
1、
orientdb> SELECT FROM Employee WHERE gender= 'male' LIMIT 20
orientdb> SELECT FROM Employee WHERE gender= 'male' SKIP 20 LIMIT 20
orientdb> SELECT FROM Employee WHERE gender= 'male' SKIP 40 LIMIT 20
INSERT
1、新增
orientdb> INSERT INTO Employee( name, surname, gender) VALUES ( 'Jay' , 'Miner' , 'M' )
orientdb> INSERT INTO Employee SET name= 'Jay' , surname= 'Miner' , gender= 'M'
orientdb> INSERT INTO Employee CONTENT {name : 'Jay' , surname : 'Miner' , gender : 'M' }
UPDATE
1、修改
orientdb> UPDATE Employee SET local = TRUE WHERE city= 'London'
orientdb> UPDATE Employee MERGE { local : TRUE } WHERE city= 'London'
DELETE
1、删除
orientdb> DELETE FROM Employee WHERE city <> 'London'