启动hbase
进入apache-phoenix-4.14.1-HBase-1.2-bin bin 目录下
使用./sqlline.py 测试
命令:
创建表:create table IF NOT EXISTS test.Person (IDCardNum INTEGER not null primary key, Name varchar(20),Age INTEGER);
查看表:!table
添加数据:upsert into test.Person (IDCardNum,Name,Age) values (100,‘小明’,12);
查看表内容:select * from test.Person;
插入一列: alter table test.person add sex varchar(10);
添加列内容: upsert into test.person (idcardnum,sex) values (100,‘男’);
更改数据: upsert into test.person(idcardnum,age)values(100,18);