Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.22 KB | None | 0 0
  1. SELECT `posts`.`id`
  2.        AS `postid`,
  3.        `posts`.`title`
  4.        AS `title`,
  5.        `posts`.`introduction`
  6.        AS `introduction`,
  7.        `posts`.`body`
  8.        AS `body`,
  9.        `posts`.`publication_date`
  10.        AS `publication_date`,
  11.        `post_categories`.`name`
  12.        AS `name`,
  13.        `posts`.`author_id`
  14.        AS
  15.        `author_id`,
  16.        Concat('http://politis-final.codingninjas.io/fromoldsite/images/',
  17.        `photos`.`image`) AS `IMGPATH`,
  18.        Concat(`authors`.`name`, ' ', `authors`.`surname`)
  19.        AS `AuthorFullname`
  20. FROM   ((((`posts`
  21.            LEFT JOIN `posts_categories`
  22.                   ON(( `posts`.`id` = `posts_categories`.`post_id` )))
  23.           LEFT JOIN `post_categories`
  24.                  ON(( `posts_categories`.`post_category_id` =
  25.                 `post_categories`.`id` )))
  26.          LEFT JOIN `photos`
  27.                 ON(( `posts`.`image_id` = `photos`.`id` )))
  28.         LEFT JOIN `authors`
  29.                ON(( `posts`.`author_id` = `authors`.`id` )))
  30. WHERE  ( ( `posts`.`created_at` < '2018-01-01 00:00:00' )
  31.          AND ( `posts`.`published` = 1 )
  32.          AND ( NOT(( `photos`.`image` LIKE '%polpictures%' )) ) )
  33. ORDER  BY `posts`.`id`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement