39 How to update data in one table from another table in sql

  Рет қаралды 16,927

Learn SSIS

Learn SSIS

Күн бұрын

Пікірлер: 23
@ajitkalawade9880
@ajitkalawade9880 Жыл бұрын
How can we do this if we have duplicates record in on codition column ...here you used customer id which is primary key...but how we do when we have duplicate column values
@learnssis
@learnssis Жыл бұрын
The syntax for update query will be same. If you have duplicate records in the table then the update query will update all records satisfying the update condition.
@buddhikaperera5716
@buddhikaperera5716 Жыл бұрын
your explanation is wonderful.. this lesson help me very much
@learnssis
@learnssis Жыл бұрын
Thank you Buddhika for your comment.
@pravingaddam8541
@pravingaddam8541 5 ай бұрын
​@@learnssisI am getting error for same query in SQL developer, ora-00933
@learnssis
@learnssis 5 ай бұрын
@@pravingaddam8541 This query is for MS SQL Server. It seems like you are using Oracle. You can ask chatgpt to convert your query for Oracle.
@pravingaddam8541
@pravingaddam8541 5 ай бұрын
@@learnssis yes tried, it's working in Oracle SQL
@exsammy84
@exsammy84 Жыл бұрын
How to include a 3rd column after AND statement? Please help
@learnssis
@learnssis Жыл бұрын
Can you please paste your query here and tell us which 3rd column you want to add ? Also do you want to include third column in where clause in update columns ?
@rakeshrajmandala6538
@rakeshrajmandala6538 Жыл бұрын
Hi, Can we update the data from tab2 to tab1 when there is no column created in tab1. Can we create a new column simultaneously.
@learnssis
@learnssis Жыл бұрын
In the update query you can't create a new column. update query is used just to update the data. if you want to create a new column then you would need to use the alter query like below alter table Salary Add EmployeeSalary money
@KranthiPasupuleti-u6i
@KranthiPasupuleti-u6i 9 ай бұрын
Thnaks a lot ....Keep Rocking ...
@learnssis
@learnssis 9 ай бұрын
Thank you Kranthi.
@laobai3517
@laobai3517 3 ай бұрын
can we edit customerID?
@learnssis
@learnssis 3 ай бұрын
You can update any column.
@laobai3517
@laobai3517 3 ай бұрын
@@learnssis but what if the colunm's value is also in another table.
@learnssis
@learnssis 3 ай бұрын
@@laobai3517 Then you need to make a join on another column in the table and update the customerID. If required you can join 2 tables based on multiple columns and then you can update customerID.
@laobai3517
@laobai3517 3 ай бұрын
@@learnssis perhaps in multiple table and i don't know exact number of the tables,, i solved it because the document exported also can be opened by notepad, so i replaced all customerID with a new value. thank you so much.
@BenMohamedInza-fp9ok
@BenMohamedInza-fp9ok 10 ай бұрын
Thank you
@buddhikaperera5716
@buddhikaperera5716 11 ай бұрын
thanks sir..
@learnssis
@learnssis 11 ай бұрын
Thank you so much.
@Grzegorz_TD
@Grzegorz_TD 8 ай бұрын
Okey? 😂
@learnssis
@learnssis 8 ай бұрын
Hey what happened ?
Updating a table from another table | UPDATE SELECT FROM | SQL Server
5:34
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН
Вопрос Ребром - Джиган
43:52
Gazgolder
Рет қаралды 3,8 МЛН
Жездуха 42-серия
29:26
Million Show
Рет қаралды 2,6 МЛН
How to Update Table From Another Table in Oracle
7:39
Adam Tech
Рет қаралды 2,2 М.
41 How to find records which are not in another table in sql
4:12
Roadmap for Learning SQL
4:52
ByteByteGo
Рет қаралды 545 М.
SQL Server Tutorial - One-to-many and many-to-many table relationships
9:51
SQL Tutorial - How to update data using joins in SQL
22:41
BeardedDev
Рет қаралды 5 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 225 М.
79 What are user defined functions in sql server
11:57
Learn SSIS
Рет қаралды 6 М.
Update a Table with values from another Table in MS Access - Office 365
5:33
SQL Tutorial - 13: Inserting Data Into a Table From Another Table
7:00
The Bad Tutorials
Рет қаралды 449 М.
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН