Search
 
SCRIPT & CODE EXAMPLE
 

SQL

update table from another table

UPDATE accounts SET (contact_first_name, contact_last_name) =
    (SELECT first_name, last_name FROM salesmen
     WHERE salesmen.id = accounts.sales_id);
Comment

PREVIOUS NEXT
Code Example
Sql :: sql server information_schema temp tables 
Sql :: connexion mysql 
Sql :: mysql connection w3 
Sql :: excel export from sql using python 
Sql :: alter table name sql 
Sql :: create table split string function in sql server 
Sql :: mysql update from select on same table 
Sql :: postgresql append array 
Sql :: how to combine diff colmun value using group by postgres 
Sql :: oracle percentage 
Sql :: get column types SQL SERVER 
Sql :: difference between primary key and unique key 
Sql :: how to inner join 4 tables in sql 
Sql :: mysql trim spaces 
Sql :: mysql get last inserted id 
Sql :: drop sequence 
Sql :: Postgres - Login and connect as default user 
Sql :: import sql in postgresql 
Sql :: psql load dump 
Sql :: truncate all tables 
Sql :: how to get date in sql 
Sql :: sql order by multiple columns 
Sql :: get clob size oracle 
Sql :: sql precent format 
Sql :: importing excel data into sql server 
Sql :: oracle dba_dependencies 
Sql :: view table mysql 
Sql :: call postgres function 
Sql :: sql remove duplicates 
Sql :: sql update multiple rows 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =