数据库
首页 > 数据库> > 数据库笔记

数据库笔记

作者:互联网

查询单独设备编码前段
SELECT * FROM localcamera_info
WHERE indexcode='65282720001310301020';

查询单独设备名字前段
SELECT * FROM localcamera_info
WHERE name='图书馆';

查询设备名字重复前段
SELECT name,count(name) FROM localcamera_info
GROUP BY name;

查询设备为0前段
SELECT * FROM localcamera_info
WHERE longitude='0' OR latitude='0';

查询不在总表里的设备编码前段
SELECT indexcode,name FROM localcamera_info
WHERE indexcode NOT IN (SELECT indexcode FROM camerashare_info);

自定义查询设备所属IP地址是多少
SELECT c.name,c.indexcode,d.networkaddr
FROM localcamera_info c
LEFT JOIN localdevice_info d ON c.deviceid=d.deviceid;

 

标签:name,数据库,笔记,localcamera,前段,查询,indexcode,SELECT
来源: https://www.cnblogs.com/yhy-blog/p/14832843.html