Trying to randomly assign values to records identified with an UPDATE statement. I know values for some conditions as in:
UPDATE Zonal SET comm_assign2 = 27 WHERE (ct_code = 2053 or ct_code = 4206) AND (mean_elev < 1280)
UPDATE Zonal SET comm_assign2 = 26 WHERE (ct_code = 2053 or ct_code = 4206) AND (mean_elev > 1730)
but if mean_elev is >= 1280 and <= 1730 I'd like to randomly SET 50% of records to comm_assign2 = 26 and 50% to comm_assign2 = 27.
Ignoring my feeble programming here, what would be the next statement? Thanks for your help!!
UPDATE Zonal SET comm_assign2 = 27 WHERE (ct_code = 2053 or ct_code = 4206) AND (mean_elev < 1280)
UPDATE Zonal SET comm_assign2 = 26 WHERE (ct_code = 2053 or ct_code = 4206) AND (mean_elev > 1730)
but if mean_elev is >= 1280 and <= 1730 I'd like to randomly SET 50% of records to comm_assign2 = 26 and 50% to comm_assign2 = 27.
Ignoring my feeble programming here, what would be the next statement? Thanks for your help!!