![](https://inmos.net/wp-content/uploads/2022/10/130042156.gif)
Error en la base de datos de WordPress: [Unknown column 'AAA' in 'field list']SELECT
( 3959 * acos ( cos ( radians(AAA) ) * cos( radians( ZZZ.meta_value ) ) * cos( radians( XXX.meta_value ) - radians(AAA) ) + sin ( radians(AAA) ) * sin( radians( ZZZ.meta_value ) ) ) ) AS distancia, inmobiliarias.ID
FROM
(SELECT A.id FROM wp_posts A, wp_term_relationships B, wp_term_taxonomy C
WHERE A.ID = B.object_id
AND B.term_taxonomy_id = C.term_taxonomy_id
AND C.taxonomy = 'category'
AND C.term_id = 10
AND A.post_status = 'publish') as inmobiliarias, wp_postmeta ZZZ, wp_postmeta XXX
WHERE inmobiliarias.ID = ZZZ.post_id
AND ZZZ.meta_key = 'latitud'
AND ZZZ.post_id = XXX.post_id
AND XXX.meta_key = 'longitud'
AND XXX.meta_value <> 'AAA'
HAVING (distancia < 1)
ORDER BY distancia ASC LIMIT 4;
Error en la base de datos de WordPress: [Unknown column 'AAA' in 'field list']SELECT
( 3959 * acos ( cos ( radians(AAA) ) * cos( radians( ZZZ.meta_value ) ) * cos( radians( XXX.meta_value ) - radians(AAA) ) + sin ( radians(AAA) ) * sin( radians( ZZZ.meta_value ) ) ) ) AS distancia, inmobiliarias.ID
FROM
(SELECT A.id FROM wp_posts A, wp_term_relationships B, wp_term_taxonomy C
WHERE A.ID = B.object_id
AND B.term_taxonomy_id = C.term_taxonomy_id
AND C.taxonomy = 'category'
AND C.term_id = 8
AND A.post_status = 'publish') as inmobiliarias, wp_postmeta ZZZ, wp_postmeta XXX
WHERE inmobiliarias.ID = ZZZ.post_id
AND ZZZ.meta_key = 'latitud_zona'
AND ZZZ.post_id = XXX.post_id
AND XXX.meta_key = 'longitud_zona'
AND XXX.meta_value <> 'AAA'
HAVING (distancia < 13)
ORDER BY distancia ASC LIMIT 1;