I need to run a select distinct from query analyzer to update a table.
Below is my attempt that did not work.
Any ideas?
Thanks,
Ron--
insert into dbo.AccountZoneTbl0
(acct_cancelcode, AccountNumber, S_ActNbr, System_no, MAS_ZoneID, o_mas_zoneid, fmt,
[Description], GroupID, DateTimeStamp, zonestate_id,
xz, zonetbl, proctbl, mas_event, z_zoneid,
p_zoneid)
select distinct(acct_cancelcode), AccountNumber, S_ActNbr, System_no, mas_cancelcode, o_mas_zoneid, 'cid',
'Cancel', GroupID, DateTimeStamp, 'A',
1, 1, 1, groupid + 'CAL', mas_cancelcode,
mas_cancelcode
from dbo.AccountZoneTbl0
where fmt = 'cid' and cancelcode is not null
Below is my attempt that did not work.
Any ideas?
Thanks,
Ron--
insert into dbo.AccountZoneTbl0
(acct_cancelcode, AccountNumber, S_ActNbr, System_no, MAS_ZoneID, o_mas_zoneid, fmt,
[Description], GroupID, DateTimeStamp, zonestate_id,
xz, zonetbl, proctbl, mas_event, z_zoneid,
p_zoneid)
select distinct(acct_cancelcode), AccountNumber, S_ActNbr, System_no, mas_cancelcode, o_mas_zoneid, 'cid',
'Cancel', GroupID, DateTimeStamp, 'A',
1, 1, 1, groupid + 'CAL', mas_cancelcode,
mas_cancelcode
from dbo.AccountZoneTbl0
where fmt = 'cid' and cancelcode is not null