Search
 
SCRIPT & CODE EXAMPLE
 

SQL

update with inner join

UPDATE tb1
SET tb1.column_1 = tb2.column_1
FROM table_1 AS tb1
INNER JOIN table_2 AS tb2
ON tb1.column_2 = tb2.column_3
Comment

inner join update

UPDATE 
    t1
SET 
    t1.c1 = t2.c2,
    t1.c2 = expression,
    ...   
FROM 
    t1
    [INNER | LEFT] JOIN t2 ON join_predicate
WHERE 
    where_predicate;
Comment

update with inner join sql server

UPDATE ProductReviews
SET    ProductReviews.status = '0'
FROM   ProductReviews
       INNER JOIN products
         ON ProductReviews.pid = products.id
WHERE  ProductReviews.id = '17190'
       AND products.shopkeeper = '89137'
Comment

update with inner join sql server

UPDATE R 
SET R.status = '0' 
FROM dbo.ProductReviews AS R
INNER JOIN dbo.products AS P 
       ON R.pid = P.id 
WHERE R.id = '17190' 
  AND P.shopkeeper = '89137';
Comment

PREVIOUS NEXT
Code Example
Sql :: string to sql timestamp 
Sql :: mysql replace remove html tag 
Sql :: sql select into statement 
Sql :: sql server backup table 
Sql :: sql current timestamp table 
Sql :: mysql datetime to date 
Sql :: sequelize migration default value 
Sql :: oracle sql select all days between two dates except weekends 
Sql :: mysql email validation 
Sql :: check if sql is installed 
Sql :: default constraint in ms sql 
Sql :: show all event schedular on mysql 
Sql :: mysql copy table to another table 
Sql :: oracle tablespace tables list 
Sql :: alter table name sql 
Sql :: mysql local password denied 
Sql :: rename a table in sql server 
Sql :: check if a column is a primary key in sql server 
Sql :: how to create a table in sql 
Sql :: delete database mysql command 
Sql :: brew start postgres 
Sql :: sql substring 
Sql :: get last 50 rows sql 
Sql :: join multiple tables sql 
Sql :: how to combine 2 tables in mysql 
Sql :: sql query to select even numbers 
Sql :: show sql server database 
Sql :: add comma after 3 digits select sql 
Sql :: SQL Multi-line Comments 
Sql :: update foreign key value in mysql 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =