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

The old company comeup with new brand MAXBEN - Logo meaning

I am so happy to design this logo for my friend Suresh Mahalingam to boost his paint business to the next level. The first step in his process is logo design. He had a clear idea about his business, processes, pricing and target audience. I just collect all those information from him and created the logo with some appropriate meanings. Check out the logo here