Skip to content

Instantly share code, notes, and snippets.

@ringmaster
Created January 24, 2013 03:14
Show Gist options
  • Save ringmaster/4617341 to your computer and use it in GitHub Desktop.
Save ringmaster/4617341 to your computer and use it in GitHub Desktop.
SELECT
DISTINCT
{posts}.id AS id,
{posts}.slug AS slug,
{posts}.title AS title,
{posts}.guid AS guid,
{posts}.content AS content,
{posts}.cached_content AS cached_content,
{posts}.input_formats AS input_formats,
{posts}.user_id AS user_id,
{posts}.status AS status,
{posts}.pubdate AS pubdate,
{posts}.updated AS updated,
{posts}.modified AS modified,
{posts}.content_type AS content_type,
ipi1.value AS info_guid_value
FROM
{posts}
LEFT JOIN {postinfo} ipi1 ON {posts}.id = ipi1.post_id AND ipi1.name = :info_key_1 AND ipi1.value = :info_value_1
WHERE
(
{posts}.status = 2
AND
{posts}.content_type = 3
AND
ipi1.name <> ''
)
AND
(
(
(1=1)
)
)
ORDER BY pubdate DESC
LIMIT 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment