🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
Phoenix Shell创建的表可以使用Hbase shell操作,但是Hbase shell 创建的表Phoenix Shell是看不到的。 <br/> ```sql -- 键表 -- 不支持 auto_increment自增 create table if not exists company( company_id integer primary key, name varchar(225) ); -- 查看表 0: jdbc:phoenix:hadoop101:2181> !tables -- 查看表的所有列 0: jdbc:phoenix:hadoop101:2181> !columns company -- 插入数据 -- 字符串只支持 '',不支持 "" upsert into company values(1, 'Microsoft'); upsert into company values(2, 'IBM'); -- 查询数据 select * from company; +-------------+------------+ | COMPANY_ID | NAME | +-------------+------------+ | 1 | Microsoft | | 2 | IBM | +-------------+------------+ -- 删除数据 delete from company where company_id=2; -- 建表 create table if not exists stock( company_id integer primary key, price decimal(10, 2) ); -- 插入数据 upsert into stock values(1, 124.9); upsert into stock values(2, 99); -- 表关联 select s.company_id, c.name, s.price from stock s left outer join company c on s.company_id = c.company_id; +---------------+------------+----------+ | S.COMPANY_ID | C.NAME | S.PRICE | +---------------+------------+----------+ | 1 | Microsoft | 124.9 | | 2 | | 99 | +---------------+------------+----------+ -- 退出 0: jdbc:phoenix:hadoop101:2181> !quit ```