Hi,
I have a table and update two fields,. one is GCD (Greatest common divisor) and another column is Ratio of that numbers. For example
Declare @Office Table (Office Varchar(20), Male Int, Female Int, GCD Int, Ratio Varchar(20))
Insert Into @Office Values ('CTS', 40, 30, NULL, NULL)
Insert Into @Office Values ('IBM', 12, 14, NULL, NULL)
Insert Into @Office Values ('TCS', 28, 32, NULL, NULL)
In the above table in first record, GCD of 40 and 30 is 10 and ratio of that two numbers with 10 is 4:3
hence, i need to update the table like this
Update @Office set GCD = 10 , set Ratio = '4:3'
Likewise i need to update all the records in that table
Could you please help me to write a Sql query for this example.