Created
February 25, 2023 00:03
-
-
Save takunagai/9989161428366869dbaa0e835928d180 to your computer and use it in GitHub Desktop.
[WordPress Sample SQL Queries] #WordPress #sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WordPress 記事タイトル/アイキャッチ画像のID を表示 | |
select | |
a.id 'ID', | |
a.post_title 'タイトル', | |
c.guid 'アイキャッチ URL' | |
from | |
(select * from wpgh_posts | |
where post_type in ('post','page','lesson') | |
and post_status='publish') a | |
left outer join wpgh_postmeta b | |
on a.id = b.post_id and meta_key = '_thumbnail_id' | |
left outer join wpgh_posts c | |
on b.meta_value = c.id | |
order by a.id | |
in (17186,16843,17185) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment