Phoenix5.1.x-hbase2.1:插入数据、查询、删除数据、修改数据

插入数据

插入数据是 update+insert结合(upsert),没有数据就插入、有数据就更新

插入数据中,包含所有列:

upsert into person values('1000','lili','20');
upsert into person values('1001','lucy','21');

插入数据中,包含部分列,需指定列名:

upsert into person(id, name) values('1002', 'hanmeimei');

查询

SELECT * FROM person WHERE age >= '21'

删除数据

delete from person where name='lili';

修改数据

注意: 修改时必须带上id,否则会报错

upsert into person(id,age) values('1001', '25');

原文出处:https://malaoshi.top/show_1IX4TNOuCCZm.html