Home > Database > Mysql Tutorial > mysql 查询结果如何把相同的主项写在一行

mysql 查询结果如何把相同的主项写在一行

WBOY
Release: 2016-06-06 09:33:19
Original
1257 people have browsed it

mysql

现在我的表结构是这样的
图片说明
然后我的语句是这样的
select time,Lon,Lat,wificonnect.mac_ap,wificonnect.rssi,wifinearby.mac_ap,wifinearby.level
from gps,low,wificonnect,wifinearby
where Lon!="0" and Lat!='0'
and gps.fk_low_id=low.pk_id
AND low.pk_id=wificonnect.fk_low_id
and low.pk_id=wifinearby.fk_low_id
and wifinearby.mac_ap!='00:00:00:00:00:00';

得到结果如下
图片说明

我想把同一个lon,lat作为唯一主项,重新建立一个以同一Lon,Lat,一个(Lon,Lat)对应多个AP的表,语句该怎么写

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template