Einzelnen Beitrag anzeigen
  #2  
Alt 29.05.2009, 22:01:27
newgame newgame ist offline
Anfänger
 
Registriert seit: May 2009
Alter: 46
Beiträge: 2
AW: Subquery Problem (Verständnis?)

Durch genaues analysieren eines mysql artikels bin ich auf die Lösung gekommen

Falls es wen interessiert:
Code:
$total ="
			SELECT wposts.*
            FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
            WHERE wposts.ID = wpostmeta.post_id
            AND wpostmeta.meta_key = '_views'
            AND wposts.post_status = 'publish'
            AND wposts.post_type = 'post'
            AND wposts.ID = ANY (
            	SELECT wposts.ID
                FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
                WHERE
                (   ( MATCH(wposts.post_title, wposts.post_excerpt) AGAINST ('".$keywords."' IN BOOLEAN MODE) )
                OR  ( wpostmeta.meta_value LIKE '%".$keywords."%' ) )
                AND wposts.ID = wpostmeta.post_id
                AND wpostmeta.meta_key = 'tags'
                AND wposts.post_status = 'publish'
                AND wposts.post_type = 'post'
            )
            ORDER BY CAST(wpostmeta.meta_value AS SIGNED) ASC
            ";
Mit Zitat antworten