SELECT *
FROM (
SELECT *,
GeomFromText(CONCAT('Point(', e.geo_latitude,' ',e.geo_longitude,')')) as _point
FROM events e
WHERE e.eventdate >= NOW()
AND e.city = 'vancouver'
AND e.seasonal = 'halloween-parties'
) as points
WHERE MBRContains(GeomFromText( 'LINESTRING(49.28090714399665 -123.04745683323608,49.28930518918205 -123.02033433567749)' ), points._point)
SELECT
am_posts.ID,
mk1.meta_value AS eventdate,
mk2.meta_value AS am2_content_unique,
mk3.meta_value AS boost_not_applicable,
mk4.meta_value AS bounce_rate,
mk5.meta_value AS bounty,
mk6.meta_value AS has_bounty,
CAST( mk7.meta_value AS SIGNED ) AS crave_eventid,
GROUP_CONCAT(am_term_relationships.term_taxonomy_id) as cities
FROM am_posts
LEFT JOIN am_postmeta mk1 ON mk1.post_id = am_posts.ID AND mk1.meta_key='eventdate'
LEFT JOIN am_postmeta mk2 ON mk2.post_id = am_posts.ID AND mk2.meta_key='am2_content_unique'
LEFT JOIN am_postmeta mk3 ON mk3.post_id = am_posts.ID AND mk3.meta_key='boost_not_applicable'
LEFT JOIN am_postmeta mk4 ON mk4.post_id = am_posts.ID AND mk4.meta_key='bounce_rate'
LEFT JOIN am_postmeta mk5 ON mk5.p
ost_id = am_posts.ID AND mk5.meta_key='bounty'
LEFT JOIN am_postmeta mk6 ON mk6.post_id = am_posts.ID AND mk6.meta_key='has_bounty'
LEFT JOIN am_postmeta mk7 ON mk7.post_id = am_posts.ID AND mk7.meta_key='crave_eventid'
LEFT JOIN am_term_relationships ON (am_posts.ID = am_term_relationships.object_id)
WHERE
am_posts.post_type = 'events'
GROUP BY am_posts.ID
SET GLOBAL general_log = 1
Zapisuje sve upite u bazu.
Lokacija loga: C:\wamp\bin\mysql\mysql5.5.24\data\ime-kompa.log
dz42 Wiki & Knowledge Base