/* 创建视图 */
create view gis_cameras_view as select a.Angle,a.X,a.Y,b.*,a.the_geom from gis_cameras a left join device_info b on a.device_id = b.device_id;
/* 删除视图 */
drop view airportdb.gis_cameral_view;
/* 查看字段信息 */
show full columns from airportdb.device_info;
/* 拷贝表 */
create table airportdb.device_info2 select * from airportdb.device_info;
/* 修改表字段 */
ALTER TABLE airportdb.device_info2 CHANGE DEVICE_NAME DEVICE_NAME VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci;
/* 查询图形字段信息 */
SELECT AsText(the_geom) FROM airportdb.gis_cameral_view;
/* 删除表 */
drop table airportdb.gis_cameral;
/* 查询表记录数 */
select count(*) from airportdb.gis_cameral;
/* 查询记录 */
SELECT * FROM airportdb.device_info where device_id = 'Y-J2-KZ12-4';
/* 权限设置 */
grant all privileges on *.* to 'root'@'%' identified by 'root'
/* 查询在指定范围内的数据 */
select * from point where id BETWEEN 1 and 20
MySQL语句
最新推荐文章于 2023-04-23 18:02:44 发布