Home Update Variable based on Group
Reply: 0

Update Variable based on Group

user489 Published in July 21, 2018, 1:52 pm

I need to perform an update to a field in a table with a variable, but I need the variable to change when the group changes. It is just an INTt, so for example if I The example below I want to update the record of texas with a 1 and flordia with the next number of 2:

UPDATE table set StateNum = @Count FROM table where xxxxx GROUP BY state

Group Update Variable Texas 1 Texas 1 Florida 2
Florida 2 Florida 2

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309823 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO