我采纳了s\\u ha\\u dum的建议,利用工会解决了这个问题。具体如下:
(SELECT ID, post_status, post_title, post_excerpt, post_content FROM wp_posts WHERE ((`post_title` LIKE \'%diamond%\') OR (`post_excerpt` LIKE \'%diamond%\') OR (`post_content` LIKE \'%diamond%\')) AND (`post_status` = \'publish\' )) UNION (SELECT ref, StoreID, Article, subarticle, description FROM wp_hwproducts WHERE (`article` LIKE \'%diamond%\') OR (`subarticle` LIKE \'%diamond%\') OR (`description` LIKE \'%diamond%\')) ORDER BY `post_status` DESC;