יום רביעי, א' אדר התשע"ו – 10.02.2016
 
 
מבזקים ועדכונים
 
 
( SELECT '1' as 'showfirst', SUBSTRING(tblTree.primary1,LOCATE('c',tblTree.primary1)+1,2) as 'pr', tblTree.object, tblArticles.showdate, tblArticles.adddate, tblArticles.shortcontent, tblArticles.title, tblTree.id, tblTree.primary1, tblTree.parent, tblArticles.guestwriter, tblArticles.writer AS writerId, writers.title AS writerName, tblPictures.id AS picFile, tblArticles.type, tblArticles.attached_video FROM tblArticles, tblTree AS writers, tblPictures, tblTree AS pictures, tblTree WHERE ( tblArticles.id = tblTree.object_id AND writers.id = tblArticles.writer AND pictures.parent = tblTree.id AND tblPictures.id = pictures.object_id AND (pictures.primary1 LIKE '0%') AND (tblTree.object='article' OR tblTree.object='review') AND tblTree.parent='40977' AND (tblTree.status='shown' OR tblTree.status='shown')) AND LOCATE('c',tblTree.primary1)>0 ) UNION ( SELECT '2' as 'showfirst', 0 as 'pr', tblTree.object, tblArticles.showdate, tblArticles.adddate, tblArticles.shortcontent, tblArticles.title, tblTree.id, tblTree.primary1, tblTree.parent, tblArticles.guestwriter, tblArticles.writer AS writerId, writers.title AS writerName, tblPictures.id AS picFile, tblArticles.type, tblArticles.attached_video FROM tblArticles, tblTree AS writers, tblPictures, tblTree AS pictures, tblTree WHERE ( tblArticles.id = tblTree.object_id AND writers.id = tblArticles.writer AND pictures.parent = tblTree.id AND tblPictures.id = pictures.object_id AND (pictures.primary1 LIKE '0%') AND (tblTree.object='article' OR tblTree.object='review') AND tblTree.parent='40977' AND (tblTree.status='shown' OR tblTree.status='shown')) AND LOCATE('c',tblTree.primary1)=0 ) UNION ( SELECT '1' as 'showfirst', SUBSTRING(tblTree.primary1,LOCATE('c',tblTree.primary1)+1,2) as 'pr', tblTree.object, 0 AS showdate, tblImportedArticles.adddate, 0 AS shortcontent, tblImportedArticles.title, tblTree.id, tblTree.primary1, tblTree.parent, 0 AS guestwriter, tblImportedArticles.website_id AS writerId, tblImportedArticles.article_id AS writerName, 0 AS picFile, 0 AS type, 0 AS attached_video FROM tblImportedArticles, tblTree WHERE ( tblImportedArticles.id = tblTree.object_id AND tblTree.object='imported article' AND tblTree.parent='40977' AND (tblTree.status='shown' OR tblTree.status='shown')) AND LOCATE('c',tblTree.primary1)>0 ) UNION ( SELECT '2' as 'showfirst', 0 as 'pr', tblTree.object, 0 AS showdate, tblImportedArticles.adddate, 0 AS shortcontent, tblImportedArticles.title, tblTree.id, tblTree.primary1, tblTree.parent, 0 AS guestwriter, tblImportedArticles.website_id AS writerId, tblImportedArticles.article_id AS writerName, 0 AS picFile, 0 AS type, 0 AS attached_video FROM tblImportedArticles, tblTree WHERE ( tblImportedArticles.id = tblTree.object_id AND tblTree.object='imported article' AND tblTree.parent='40977' AND (tblTree.status='shown' OR tblTree.status='shown')) AND LOCATE('c',tblTree.primary1)=0 ) UNION ( SELECT '2' as 'showfirst', 0 as 'pr', 'copied article' AS 'object', tblArticles.showdate AS showdate, tblArticles.adddate, tblArticles.shortcontent AS shortcontent, tblArticles.title, tblTree.id, tblTree.primary1, tblTree.parent, tblArticles.guestwriter AS guestwriter, tblArticles.writer AS writerId, writers.title AS writerName, tblPictures.id AS picFile, tblArticles.type AS type, tblArticles.attached_video AS attached_video FROM tblArticles, tblTree AS writers, tblPictures, tblTree AS pictures, tblTree WHERE tblArticles.id = tblTree.object_id AND writers.id = tblArticles.writer AND pictures.parent = tblTree.id AND tblPictures.id = pictures.object_id AND pictures.primary1 LIKE '0%' AND tblTree.status='shown' AND tblArticles.id IN (SELECT object_id FROM `tblTree` WHERE `tblTree`.id IN( SELECT `tblTree_id` FROM `tblParents` WHERE `parent` = '40977' ) AND object = 'article') ) ORDER BY showfirst, pr DESC, adddate DESC LIMIT 30
אינדקס אינטרנטי לעסקים
חפש