How do I UPDATE from a SELECT in SQL server

0 votes

can we  update a table with SELECT? A temporary table containing the values and and  update another table using those values  can we do it

May 26, 2022 in Others by polo
• 1,480 points
371 views

1 answer to this question.

0 votes

In SQL Server, it is possible to insert rows into a table with INSERT, SELECT statement:

INSERT into TABLE (col1, col2, col3)
SELECT col1, col2, col3 
FROM OLD_TABLE 
WHERE sql = 'cool'

 update a table with SELECT:

UPDATE Table SET column1, column2
SELECT column1, column2 
FROM OLD_TABLE
WHERE sql = 'cool'
WHERE Table.id = OLD_TABLE.id
answered May 30, 2022 by anisha
• 140 points

Related Questions In Others

0 votes
1 answer
0 votes
1 answer

How can I open a URL in Android's web browser from my application?

ry this: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri ...READ MORE

answered Jun 14, 2022 in Others by polo
• 1,480 points
4,188 views
0 votes
1 answer

How Can I use "Date" Datatype in sql server?

Your dates are interpreted as MM-DD-YYYY. This ...READ MORE

answered Jun 21, 2022 in Others by nisha
• 2,210 points
338 views
0 votes
1 answer

In excel how do I reference the current row but a specific column?

Put a $ symbol in front of ...READ MORE

answered Oct 15, 2022 in Others by narikkadan
• 63,420 points
1,351 views
0 votes
1 answer
0 votes
1 answer

How do I protect all worksheet in an Excel workbook with a single click?

VBA Code : Dim ws as Worksheet Dim pwd ...READ MORE

answered Oct 22, 2022 in Others by narikkadan
• 63,420 points
545 views
0 votes
1 answer

How do I UPDATE from a SELECT in SQL Server?

MERGE INTO YourTable T USING ...READ MORE

answered Feb 3, 2022 in Database by Vaani
• 7,020 points
591 views
0 votes
0 answers

How do I UPDATE from a SELECT in SQL Server?

INSERT INTO Table (col1, col2, col3) SELECT col1, ...READ MORE

Feb 4, 2022 in Database by Vaani
• 7,020 points
328 views
0 votes
1 answer

How can we UPDATE from a SELECT in an SQL Server

We can firstly use SELECT statement to fetch ...READ MORE

answered May 27, 2022 in Others by Avinash
• 240 points
4,018 views
0 votes
1 answer

What is a stored procedure?

A stored procedure is a set of ...READ MORE

answered Feb 4, 2022 in Database by Neha
• 9,060 points
801 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP