SELECT *
FROM wp_posts, wp_2_posts, wp_3_posts
WHERE
wp_posts.post_content LIKE '%foo' OR
wp_2_posts.post_content LIKE '%foo' OR
wp_3_posts.post_content LIKE '%foo';
should do the trick.
(Note that in Multisite, there shouldn’t be a wp_1_posts
— your root site uses wp_posts
etc.)
Related Posts:
- Change all http to https in mysql databse?
- WooCommerce – Query for ordered products
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- Query WordPress database by registered date and role
- Select Multiple meta_value from WP DB; Single Query
- WordPress mysql table double prefixes
- CRUD operations using WordPress database API
- Advanced SELECT query with condtional statements
- Slow queries constantly getting stuck on WordPress database of ~100,000 posts
- Custom WordPress Table wpdb
- Best practice to limit results in get_row()?
- Why does changing Database Table Prefixes result in loss of content?
- SQL query to set posts in bulk based on the post content
- Query Column of Specific ID from Database Table
- How to edit custom table data in frontend
- WordPress Database Query works in phpMyAdmin but not in the code
- How to map data on CSV to web pages?
- SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta
- Have WordPress Use a Different Database for users
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- Using wpdb to connect to a separate database
- get_results using wpdb
- The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
- wpdb->insert multiple record at once
- Is it possible to define two databases for one installation?
- WordPress for a very large website
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- How best to inject ads between posts in the loop?
- Change SQL get_results to search for posts with custom term in custom taxonomy
- Error establishing a database connection – with Debug Data
- How to execute mulitple statement SQL queries using $wpdb->query?
- stdObject stored in database. How does one convert it to usable format?
- Can I transfer a mysql database to another site?
- Set Display Name to first and last name (phpmyadmin SQL Query)
- Is it good practice to use wpdb->query() function?
- Migrating database / content of non-CMS site to WordPress
- Does WordPress ever need multiple databases?
- Why are no posts showing despite my apparently correct DB restoration?
- How to query the WordPress database to get posts of a certain custom post type, taxonomy and field?
- Delete all post meta except featured image Using SQL
- Adding new row to wp_post table
- SQL Error wp_commentmeta – incorrect table definition
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- Change WordPress prefix for only one table?
- How do I get the posts within a certain year/date(with sql query)?
- Select two sums with single get_var statement
- input data and output table [closed]
- Migration: Copying database content to a different server
- Call to undefined function get_user_meta() – trying to access data in MySQL from custom fields
- Have working sql query… trying to adjust it to use $wpdb
- Changing root password in PHPMyAdmin for WordPress Database when going live
- How to properly check if a table exists in WordPress Database using Show Tables Query
- Can’t update WordFence Options, clear data manually
- creating new field on mysql
- $wpdb->query can’t insert data
- How can I detect right db type?
- How to create more than one new wpdb object?
- Custom search query by category id
- Files on Localhost, Database on Server
- Remote database -> massive response time increase?
- Second ezSQL initialization for MSSQL
- Fetch a single row from a custom table for to a given ID
- Database create or redirect
- Getting “Error Establishing a Database Connection” on localhost in new Mac OSX Lion environment
- SQL error with custom query
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- DB prefix not updating
- Recovery – Restore Database after moving folder location locally
- Replacing javascript link in WordPress database without getting mysql syntax errors
- What is my error trying to create a new table in the database?
- Job and Employee Performance Tracking with Product Safety
- local wordpress broke after changing URL
- how to access 2nd Mysqli Database from different server for wordpress
- Error establishing a database connection – WordPress setup, everything else is working
- Set SQL_BIG_SELECTS and MAX_JOIN_SIZE on a WP_Query
- Search and Replace in Windows XAMPP site
- WPCLI search and replace in a particlar site dir effect another site-dir
- How can i syn wordpress user table with a stand-alone php script?
- insert data from a form:: Warning Empty query mysqli::query()
- How can I get $wpdb to show MySQL warnings?
- How can we speed up wp_get_nav_menu_items()?
- WordPress Database Posts Table query
- Hang Up Followed By Can’t select database
- Should I Use only wpdb Class to Write Custom Queries?
- Generating an HTML table from an array based on dynamic key values
- How to extract some part of WordPress full source code
- Mysql Queries per Visit – Crazy High
- WP_Query always returning the last custom post
- using same mysql user with many databases
- Insert double entry in DB
- Pulling values from a sepcific row in table
- Why are my WordPress post queries so slow?
- Create hundreds of users with just ID in phpMyAdmin
- Migrated to Namecheap, now Trouble with Database & wp-config [closed]
- Custom wordpress SQL statement for a website
- WordPress database connection failed, while mysql client is working [closed]