Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Update Select Mysql

UPDATE
    `table1` AS `dest`,
    (
        SELECT
            *
        FROM
            `table2`
        WHERE
            `id` = x
    ) AS `src`
SET
    `dest`.`col1` = `src`.`col1`
WHERE
    `dest`.`id` = x
;
Comment

update select mysql

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
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql if else 
Sql :: select the date 30 days less that the todays date sql request 
Sql :: SQL BACKUP DATABASE for SQL Server 
Sql :: sqlite select split string 
Sql :: sql select all records from all tables where not empty 
Sql :: sql find leading space 
Sql :: insert or ignore postgres 
Sql :: difference between 2 query results sql server 
Sql :: how to define a save method in ruby for sqlite3 databases 
Sql :: sql query inner join 3 tables 
Sql :: oracle show errors 
Sql :: delete from table sql 
Sql :: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: 
Sql :: start and stop mysql 
Sql :: postgresql delete all content 
Sql :: how to create a table based on another table in mysql 
Sql :: mysql grant user permissions 
Sql :: drush SQLSTATE[HY000] [2002] No such file or directory 
Sql :: run psql postgres docker 
Sql :: export mysql table to file 
Sql :: max length found in mysql 
Sql :: insert into postgres 
Sql :: sql check if table exists 
Sql :: like query 
Sql :: sql if else 
Sql :: delete table sqlite 
Sql :: spark apache sql coalesce 
Sql :: mysql default -temp password 
Sql :: delete and drop in sql 
Sql :: Get a list of tables and the primary key 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =