Skip to main content

(Wordpress) Converting wp_metapost data as column

CREATE OR REPLACE view test as (
 select
   wp_postmeta.post_id,
   case when meta_key = "<YOUR_KEY>" then meta_value end as columnName1,
    case when meta_key = "<ANOTHER_KEY>" then meta_value end as columnName2
 from wp_postmeta
   where meta_value not like ''
);



Example:
CREATE OR REPLACE view test as (
 select
   wp_postmeta.post_id,
   case when meta_key = "old_page_url" then meta_value end as url,
    case when meta_key = "meta_description" then meta_value end as meta_description
 from wp_postmeta
   where meta_value not like ''
);


This will create a new view with two columns.

Comments

Popular posts from this blog

#ThankYouCitrisys

MAY 5, 2015 an unforgettable day in my life. Why this award is so special to me? Because, after 8 years (After completion of Engineering), I landed on a good place where they identified me and involved me in the good projects with suitable PMOs. With all their support in Citrisys, I did small things with my involvement. For that, Citrisys, awarded me this "Award of Excellence". This award not shows me the best performance, but, it shows me to work more and more. Thank you Mr.ARA (CEO, Citrisys Solutions) for this award. #ThankYouCitrisys

Citrisys Poster Competition work 02