初识java连接Phoenix遇到的坑

xiaoxiao2021-02-27  258

1.在一个项目中遇到java连接phoenix,需要做翻页操作。 我开始用了select * from tableName limit 1,10;发现不起作用,跟mysql语法不一样,phoenix中limit后面只能跟一位。最后经查阅,应该这样使用 select * from tableName limit 10 offset 1; 2.phoenix中向表插入数据语法: upsert into test1 (id,id1,id2,relation,times) VALUES(‘3’,’川A00000’,’川B00000’,2,3); 注意:值不能是双引号,只能是单引号 3.phoenix中在子查询中不支持通配符 比如 SELECT id2 as car,sum(relation) from (SELECT * from test1 union ALL SELECT * from test2) a GROUP BY car; 会报错,而 SELECT id2 as car,sum(relation) from (SELECT id2,relation from test1 union ALL SELECT id2,relation from test2) a GROUP BY car;(正确的)

转载请注明原文地址: https://www.6miu.com/read-7263.html

最新回复(0)