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
- #1067 – Invalid default value for ‘post_date’ when trying to create a new column
- SQL errors when querying for something with apostrophes
- Count views without get_post_meta
- 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)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- MySQL SELECT increment counter
- phpMyAdmin – Error > Incorrect format parameter?
- 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
- MySQL Database User: Which Privileges are needed?
- Why is my database import losing text widget data?
- get_results using wpdb
- Will it break my site if I delete all transient records in wp_options table?
- Checking if Database Table exists
- WordPress (MyISAM) database is slow, should I switch to InnoDB?
- Please explain how WordPress works with MySQL character set and collation at a low level
- The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
- How to fetch Data in WordPress using MySQLi or $wpdb
- WordPress Database lost auto increment
- Count & Display Database Queries
- Connect to database using wordpress wp-config file
- wpdb->insert multiple record at once
- Reset Post IDs to less than 64bit integer
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Restoring WordPress posts from database only
- WordPress database scalability from the code perspective
- WordPress Unit Testing – Cannot Create Tables
- How to define composite keys with dbDelta()
- Insert data in database using form
- Is it possible to define two databases for one installation?
- Does WordPress use the InnoDB engine for MySQL by default?
- When is it appropriate to create a new table in the WordPress database?
- Has parent field in the table wp_term_taxonomy has term_id or term_taxonomy_id
- Slow wp_term_relationships query
- How to use “TRUNCATE TABLE” MySQL statement?
- Can I use MariaDB instead of MySQL in wordpress?
- Export wordpress table to excel
- Using Dynamic Data Pulled from a MySQL Table in a WordPress Page
- How To Make Connection To WordPress Data Base In A Plugin?
- WordPress for a very large website
- What are conventions about the schema of the $table_prefix
- Split WP install between 2 databases?
- Inserting Post Meta From SQL
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- Why does dbDelta() not catch MysqlErrors?
- BuddyPress: What’s the use of wp_bp_xprofile_data table and how does it get updated? [closed]
- Is deleting orphaned wp_options entries safe?
- Is altering a default WordPress database table update safe?
- How best to inject ads between posts in the loop?
- How to solve slow WordPress site caused by attachment_metadata
- Huge wp_options table
- “MySQL server has gone away” since update to 3.8
- Change SQL get_results to search for posts with custom term in custom taxonomy
- How to sort results from a custom database table
- Delete all post meta except featured image
- Custom DB_COLLATE (collation) value not working on fresh install?
- What causes the “max_user_connections” warning on WordPress frontend?
- what to do when your WordPress database is too large?
- How to find if a post with custom_field == X exists?
- PHP variable in WordPress database query
- Large database causes slow load
- Error establishing a database connection – with Debug Data
- WP database error for comments_popup_link()
- How to execute mulitple statement SQL queries using $wpdb->query?
- stdObject stored in database. How does one convert it to usable format?
- Database slowdown after update to 3.4.1
- Can I transfer a mysql database to another site?
- WordPress and automated MySQL backups to a different host
- MySQL Syntax Error upon restoring database from backup [closed]
- Tons of Twitter rows in my database
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- How to insert data into MySQL database from the form created in WordPress site
- Set Display Name to first and last name (phpmyadmin SQL Query)
- How Do I Merge Categories With phpMyAdmin
- Size article thumbnails and retrieve them directly from database
- WordPress site uses MyISAM, should I switch to InnoDB necessary?