You can actually do this one of two ways:
MySQL update join syntax:
UPDATE tableA a INNER JOIN tableB b ON a.name_a = b.name_b SET validation_check = if(start_dts > end_dts, 'VALID', '') -- where clause can go here
ANSI SQL syntax:
UPDATE tableA SET validation_check = (SELECT if(start_DTS > end_DTS, 'VALID', '') AS validation_check FROM tableA INNER JOIN tableB ON name_A = name_B WHERE id_A = tableA.id_A)
Pick whichever one seems most natural to you.
Related Posts:
- mysql update multiple columns with same now()
- MySQL error code: 1175 during UPDATE in MySQL Workbench
- Create a temporary table in a SELECT statement without a separate CREATE TABLE
- MySQL Select Multiple VALUES
- MySQL – UPDATE query with LIMIT
- MySQL Rank & $wpdb
- How to search usermeta table
- SELECT statement wrong?
- Column count doesn’t match value count at row 1
- MySQL error 2006: mysql server has gone away
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- “INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”
- #1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’
- What is the definition of cardinality in SQL
- MySQL SELECT increment counter
- what does “/index.php?admin/admin_dashboard” in my url mean
- How to join two tables by multiple columns in SQL?
- How to get size of mysql database?
- SQL – Update multiple records in one query
- Difference between VARCHAR and TEXT in MySQL
- MySQL Error 1093 – Can’t specify target table for update in FROM clause
- mysqladmin: connect to server at ‘localhost’ failed
- Usage of MySQL’s “IF EXISTS”
- How to avoid MySQL ‘Deadlock found when trying to get lock; try restarting transaction’
- Simple Random Samples from a Sql database
- What does SQL clause “GROUP BY 1” mean?
- LAST_INSERT_ID() MySQL
- SQL select only rows with max value on a column
- Trying to perform MINUS operation in MySQL
- MySQL IF NOT NULL, then display 1, else display 0
- How do I find which transaction is causing a “Waiting for table metadata lock” state?
- MySQL – UPDATE multiple rows with different values in one query
- mysql count duplicates
- phpmyadmin #1045 Cannot log in to the MySQL server. after installing mysql command line client
- MySQL config file location – redhat linux server
- Create boolean column in MySQL with false as default value?
- Is there a naming convention for MySQL?
- ERROR 1115 (42000): Unknown character set: ‘utf8mb4’
- Error Code 1292 – Truncated incorrect DOUBLE value – Mysql
- MySql – HAVING vs WHERE
- How to stop mysqld
- Is merge statement available in MySQL
- GROUP_CONCAT comma separator – MySQL
- Error: Duplicate entry ‘0’ for key ‘PRIMARY’
- Why are simple updates to wp_postmeta’s “_edit_lock” so slow?
- Set page template for all pages?
- Optimize Multiple Taxonomy Term MySQL Query?
- WordPress MySQL & PHP Performance
- What specific database privileges does WordPress need?
- Using source control with WordPress
- My WordPress site always displays a cached version of its homepage
- Updating User Meta with SQL Query
- query to create woocommerce products from images
- wpdb prepare syntax
- How to run this SQL query of wp_terms database
- Proper way to work with wpdb to get user’s firstname
- How to change post format from Aside to Image for all posts?
- Inserting Hundreds of Thousands of Posts at Once
- wp_admin edit.php slow with lots of queries
- How to add and SQL query of posts only published
- Slow Mysql Queries
- can database and media folder be moved to a different drive?
- Find duplicate posts with same slug and author
- writing inner join in wpdb
- How to get data from WordPress site sql file
- Unknown collation when I import a dump from an existing site into a development database?
- PHP script can’t connect to Database on port 3307
- WordPress with php5-fpm and nginx
- When WordPress Default table, Echo Success. When Plugin Table, Echo Blank
- How to translate this mySQL query to $wpdb query
- $wpdb to insert html form information
- Proper usage of $wpdb->update()?
- MySQL 5.5 upgrade ‘broke’ WordPress [closed]
- Separate DB by yearly archive of WordPress
- Paypal Post IPN handeling nightmare
- What should a WordPress developer know about MySQL? [closed]
- Copyright: Get first and last date of post type
- Update MySQL query so that it functions again
- Query posts by custom taxonomy and sort by post_modified
- WordPress $wpdb get posts from category and sort by custom meta
- Array Formation Issue
- Migration problems with mysql: Operation not allowed when innodb_forced_recovery > 0 [closed]
- WordPress $wpdb no result
- (WP List Table) How to sort by SKU and Custom Fields?
- User set date and time from frontend doesn’t get stored into database
- when using $wpdb sudden connection rejection without changing anything. Access denied, with errors from repair tool
- How to bulk delete a certain part of all wordpress posts
- edit_user_created_user hook – using to update Groups
- Mysql Error in querying form entries in Gravity Form plugin
- update_option returns false in AJAX, how to debug?
- Improving performance of SQL sub-queries in WordPress
- Saving custom term value to the database in new table
- MySQL errors after a WordPress clone
- MYSQL Join on meta key value?
- Complicated MySQL Query
- problem with quotes on new post
- Where other than wp-config can database access details be defined?
- Why does the MySQL command line tool ignore the –port parameter?
- Postgres equivalent to MySQL’s \G?
- Possible SQL injection. How to locate and fix?