Seems like you are looking for a pure SQL solutions for this. You can achieve this by running the following query:
UPDATE wp_posts
SET latitude_longitude = CONCAT(latitude, ", " , longitude);
That will work for you, just double check the name of the columns: latitude_longitude
, latitude
and longitude
.
Update
If you want to run that SQL query each time a post is saved you can use a hook as shown below:
function update_post_location( $post_id ) {
// If this is just a revision, do not update.
if ( ! wp_is_post_revision( $post_id ) )
return;
$query = 'UPDATE wp_posts ' .
'SET latitude_longitude = CONCAT(latitude, ", " , longitude) ' .
'WHERE id = ' . $post_id;
$wpdb->query( $query )
}
add_action( 'save_post', 'update_post_location' );