mysql报错 lajur 'a.plat' tidak diketahui dalam klausa ON
漂亮男人
漂亮男人 2017-06-30 09:54:48
0
1
1043
select truncate(a.lat, 2) as plat, truncate(a.lng, 2) as plng, temp.latt, temp.lngt from user_post as a inner join 
(select truncate(user_post.lat, 2) as latt, truncate(user_post.lng, 2) as lngt from user_post group by latt, lngt having count(latt) >= 4 and count(lngt)>= 4) as temp 
on (a.plat = temp.latt and a.plng = temp.lngt);

Mengapa ralat sedemikian dilaporkanunknown column 'a.plat' in ON clause ?

漂亮男人
漂亮男人

membalas semua(1)
phpcn_u1582

aAlias ​​menunjuk ke jadual user_post Berdasarkan pernyataan anda, jadual user_post mempunyai medan lat tetapi tiada medan plat.
Jadi a.plat dalam syarat adalah salah.

Cuba tambah kurungan:

select a.plat, a.plng, temp.latt, temp.lngt 

from 

(select truncate(lat, 2) as plat, truncate(lng, 2) as plng from user_post) as a 

inner join 

(select truncate(lat, 2) as latt, truncate(lng, 2) as lngt from user_post group by latt, lngt having count(latt) >= 4 and count(lngt)>= 4) as temp 

on a.plat = temp.latt and a.plng = temp.lngt;
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan