清空表:
TRUNCATE TABLE table_name;
清空表并还原自增id:
TRUNCATE TABLE raw_lte_cell RESTART IDENTITY;
postgresql基本功能:创建表、新增列、修改列字段名称、某列值自增或循环自增
https://blog.csdn.net/zsc201825/article/details/84285446
https://blog.csdn.net/kmust20093211/article/details/48089105
1. select * from user_info where create_date >= '2015-07-01' and create_date < '2015-08-15’;
2. select * from user_info where create_date between '2015-07-01' and '2015-08-15’;
3. select * from user_info where create_date between to_date('2015-07-01','YYYY-MM-DD') and to_date('2015-08-15','YYYY-MM-DD’);
SELECT * FROM table_name order by id desc limit 1;
psql -U user_name -d db_name -h ipadress -p 5432
语法:
单列索引:
CREATE INDEX index_name
ON table_name (column_name);
组合索引:
CREATE INDEX index_name
ON table_name (column1_name, column2_name);
原则:
CREATE INDEX idx_raw_lte_cell_start_time_end_time on raw_lte_cell (start_time, end_time);
CREATE INDEX idx_raw_lte_cell_start_time_end_time on raw_lte_cell using brin (start_time, end_time);
/d tb_name;
\di
DROP INDEX index_name;