Home Update Variable based on Group
Reply: 0

Update Variable based on Group

user489
1#
user489 Published in April 22, 2018, 6:05 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.32255 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO