I want to learn how to run commands through WP rather than SQL commands
I have a SQL command:
SELECT
post_id,
(select meta_value from wp_postmeta where meta_key = a 'geo_latitude' AND x.post_id = a.post_id) as lat is NOT NULL,
(select meta_value from wp_postmeta where meta_key = b 'geo_longitude' AND x.post_id = b.post_id) as lon is NOT NULL,
(select meta_value from wp_postmeta where meta_key = c 'address' AND x.post_id = c.post_id) as the address is NOT NULL
FROM elreal_postmeta x group by post_id, lat, lon, address
Can I run this command into the wpdb
class?