Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Command to update column with the same columns value with different criteria

$
0
0

Hi, probably a simple command but I am trying to update a column that has a certain location with the values of that same column for a different location and I am unsure as to how it would work. Both fields are in the same table. Using Pervasive SQL v13

Ex:

Table - Items

ItemName Location QTY

Part1   Loc1   99

Part1   Loc2   2

With that example I would want to update the QTY field for all part1s for loc1 to instead have the QTY of part1 for loc2, so in the end it would be...

Table - Items

ItemName Location QTY

Part1   Loc1   2

Part1   Loc2   2


Thanks!


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>